SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.31082 · ICML · 2026

Fleet: Few Shots Lead Effective AI-generated Image Detection

Yu Li, Kaiyuan Yang, Juan Cao, Jiaan Wang, Sheng Tang, Sirui Liu

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 5 failures of our instrument; 5 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2606.31082.json · badge: /api/ran/2606.31082.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ICTMCG/Fleet community
Papers with Code archive
7 ran · 5 no recorded run
FunctionStatusWhere it lives
DualBranchImageDataset Ran
ran on a synthesized input
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("3e7f9756aa545c01")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image
import tempfile
import os

# Create temporary image files for the dataset
temp_dir = tempfile.mkdtemp()
image_paths = []
for i in range(3):
    img = Image.new('RGB', (256, 256), color=(i*80, i*60, i*40))
    img_path = os.path.join(temp_dir, f'img_{i}.png')
    img.save(img_path)
    image_paths.append(img_path)

labels = [0, 1, 0]

# Mock processor that mimics a HuggingFace processor
class MockProcessor:
    def __call__(self, img, return_tensors=None):
        # Convert PIL image to tensor and normalize
        img_tensor = torch.tensor(np.array(img), dtype=torch.float32).permute(2, 0, 1) / 255.0
        # Apply ImageNet normalization
        mean = torch.tensor([0.485, 0.456, 0.406]).view(3, 1, 1)
        std = torch.tensor([0.229, 0.224, 0.225]).view(3, 1, 1)
        img_tensor = (img_tensor - mean) / std
        return {'pixel_values': img_tensor.unsqueeze(0)}

processor = MockProcessor()

INIT_ARGS = {
    'image_paths': image_paths,
    'labels': labels,
    'processor': processor,
    'xception_crop_size': 128,
    'is_training': True,
    'max_load_warnings': 5
}

METHOD = '__getitem__'

ARGS = {
    'idx': 0
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
apply_fft_high_freq_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("78e549da5156b337")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family float, shape (3, 128, 128) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a valid image tensor with shape [3, H, W] in range [0, 1]
# Using 128x128 to match the default xception_crop_size
img_tensor = torch.rand(3, 128, 128)

ARGS = {
    "img_tensor": img_tensor,
    "xception_crop_size": 128,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 128, 128) — shape (3, 128, 128) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
collect_aigibench_image_paths Ran
ran; our contract draft was wrong, not the code
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("a6db87c3c0ed2c6a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure that mimics AIGIBench layout
temp_dir = tempfile.mkdtemp()

# Create category structure: category/category/{0_real,1_fake}
category_name = "test_category"
category_path = os.path.join(temp_dir, category_name)
nested_category_path = os.path.join(category_path, category_name)
os.makedirs(nested_category_path, exist_ok=True)

# Create 0_real and 1_fake subdirectories
real_dir = os.path.join(nested_category_path, "0_real")
fake_dir = os.path.join(nested_category_path, "1_fake")
os.makedirs(real_dir, exist_ok=True)
os.makedirs(fake_dir, exist_ok=True)

# Create some dummy image files
with open(os.path.join(real_dir, "image1.jpg"), "w") as f:
    f.write("dummy")
with open(os.path.join(real_dir, "image2.png"), "w") as f:
    f.write("dummy")
with open(os.path.join(fake_dir, "fake1.jpg"), "w") as f:
    f.write("dummy")
with open(os.path.join(fake_dir, "fake2.jpeg"), "w") as f:
    f.write("dummy")

# Also create a flat structure category/{0_real,1_fake} for testing
flat_category_name = "flat_category"
flat_category_path = os.path.join(temp_dir, flat_category_name)
os.makedirs(flat_category_path, exist_ok=True)

flat_real_dir = os.path.join(flat_category_path, "0_real")
flat_fake_dir = os.path.join(flat_category_path, "1_fake")
os.makedirs(flat_real_dir, exist_ok=True)
os.makedirs(flat_fake_dir, exist_ok=True)

with open(os.path.join(flat_real_dir, "real1.bmp"), "w") as f:
    f.write("dummy")
with open(os.path.join(flat_fake_dir, "fake1.png"), "w") as f:
    f.write("dummy")

ARGS = {
    "data_dir": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_anchors Ran
ran, honoured the contract we drafted
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("4ff617422653db4e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal model that matches the function's usage
class DummyModel(nn.Module):
    def __init__(self, num_heads=4):
        super().__init__()
        self.num_heads = num_heads
        self.linear = nn.Linear(8, 2)  # simple classifier
    
    def forward(self, img_dinov3, img_xception):
        # Combine inputs and produce output and attention weights
        batch_size = img_dinov3.shape[0]
        # Logits for classification
        logits = self.linear(torch.cat([img_dinov3, img_xception], dim=1))
        # Attention weights: [batch_size, num_heads]
        attn_weights = torch.softmax(torch.randn(batch_size, self.num_heads), dim=1)
        return logits, attn_weights

# Create model
model = DummyModel(num_heads=4)

# Create memory loader - list of batches with (img_dinov3, img_xception, labels)
# Each batch has 2 samples: one fake (label=0), one real (label=1)
img_dinov3_batch1 = torch.randn(2, 4)  # batch_size=2, dim=4
img_xception_batch1 = torch.randn(2, 4)  # batch_size=2, dim=4
labels_batch1 = torch.tensor([0, 1])  # one fake, one real

img_dinov3_batch2 = torch.randn(2, 4)
img_xception_batch2 = torch.randn(2, 4)
labels_batch2 = torch.tensor([0, 1])

memory_loader = [
    (img_dinov3_batch1, img_xception_batch1, labels_batch1),
    (img_dinov3_batch2, img_xception_batch2, labels_batch2),
]

# Device is CPU
device = 'cpu'

ARGS = {
    'model': model,
    'memory_loader': memory_loader,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
distillation_loss Ran
ran; our contract draft was wrong, not the code
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("212d49801c4ec215")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small feature tensors
# batch_size=2, feature_dim=4
current_features = torch.randn(2, 4)
original_features = torch.randn(2, 4)

# Normalize to make them more like feature vectors
current_features = torch.nn.functional.normalize(current_features, dim=1)
original_features = torch.nn.functional.normalize(original_features, dim=1)

weight = 1.0

ARGS = {
    "current_features": current_features,
    "original_features": original_features,
    "weight": weight,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
infer_q_dim_and_spec_from_paths Ran
ran; our contract draft was wrong, not the code
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("22367612659e52d0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def infer_q_dim_and_spec_from_paths(paths):
    for p in paths:
        if not p:
            continue
        m = re.search('_q(\\d+(?:_[A-Za-z0-9]+)*)', str(p))
        if not m:
            continue
        q_spec = m.group(1)
        q_dim_str = q_spec.split('_', 1)[0]
        try:
            q_dim = int(q_dim_str)
        except ValueError:
            continue
        return (q_dim, q_spec)
    return (None, None)


ARGS = {
    "paths": [
        "model_q8_int8",
        "checkpoint_q16_symmetric",
        "weights_q4_nf4"
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mutual_avoidance_loss Ran
ran; our contract draft was wrong, not the code
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("dfa98dbc64130a09")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create tiny tensors for the function
batch_size = 2
embedding_dim = 4

# attn_weights: shape (batch_size, embedding_dim)
attn_weights = torch.randn(batch_size, embedding_dim)

# labels: shape (batch_size,) with values 0 or 1
labels = torch.tensor([0, 1])

# fake_anchor: shape (embedding_dim,)
fake_anchor = torch.randn(embedding_dim)

# real_anchor: shape (embedding_dim,)
real_anchor = torch.randn(embedding_dim)

# weight: scalar float
weight = 1.0

ARGS = {
    "attn_weights": attn_weights,
    "labels": labels,
    "fake_anchor": fake_anchor,
    "real_anchor": real_anchor,
    "weight": weight,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_q_train_module Not yet run
unverified (harvested, no recorded run)
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("e466dc46011d56a6")
How it ran

no invocation recorded.

print_validation_summary Not yet run
unverified (harvested, no recorded run)
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("2e9d243e5929b82d")
How it ran

no invocation recorded.

run_experiment Not yet run
unverified (harvested, no recorded run)
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("5afbfae2678a5e07")
How it ran

no invocation recorded.

train_epoch Not yet run
unverified (harvested, no recorded run)
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("6821b40928095e1a")
How it ran

no invocation recorded.

validate_with_prototypes Not yet run
unverified (harvested, no recorded run)
ICTMCG/Fleet/src/fleet/train/fewshot_experiment.py
code served (permissive licence) · get_code("e28308ca9ed2edc8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

AI-generated image (AIGI) detection is undergoing a critical transition from laboratory benchmarks to open-world adversarial defense. The prevalent paradigm focuses on finding static feature spaces, assuming that some invariant artifacts learned from historical data can achieve universal zero-shot generalization. While achieving saturation on several AIGI benchmarks, this static hypothesis suffers a severe performance drop against rapidly evolving generators (e.g., SD3, Nano Banana Pro). To address these limitations, we propose that the field should expand beyond "static generalization" to a new paradigm of "dynamic adaptation". We introduce Fleet, a framework that pioneers a dynamic paradigm of continuous few-shot evolution, enabling rapid alignment with emerging generative threats. Fleet improves few-shot adaptation by replacing unconstrained feature updates with constrained routing correction, where avoidance routing redirects novel AI samples away from Non-AI-dominated routes within decoupled subspaces. To validate this, we present Treasure, a benchmark spanning 64 models and 360k images, featuring diverse architectures and 20 closed-source commercial engines. Experiments reveal that while static SOTA methods fail catastrophically on modern generators, Fleet restores performance from 20.4% to 73.1% with only 10-shot adaptation on "Doubao Seedream 4.0". Code and data are available at https://github.com/ICTMCG/Fleet.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2606.31082")
get_code_for_paper("2606.31082")
have("2606.31082")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2606.31082.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2606.31082.svg)](https://syntology.ai/paper/2606.31082)

Connect an agent — have() is free.