SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.00395 · 2023

MobileViG: Graph-Based Sparse Attention for Mobile Vision Applications

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2307.00395.json · badge: /api/ran/2307.00395.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
sldgroup/mobilevig canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
FunctionStatusWhere it lives
build_dataset Ran
ran; our contract draft was wrong, not the code
sldgroup/mobilevig/util/datasets.py
code served (permissive licence) · get_code("e07e90c2695fc1f1")
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. 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 os
import json
import tempfile
import shutil
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create minimal CIFAR-like directory structure
os.makedirs(os.path.join(temp_dir, 'train'), exist_ok=True)
os.makedirs(os.path.join(temp_dir, 'val'), exist_ok=True)

# Create dummy images for ImageFolder dataset
for split in ['train', 'val']:
    for class_id in range(2):
        class_dir = os.path.join(temp_dir, split, str(class_id))
        os.makedirs(class_dir, exist_ok=True)
        for img_id in range(2):
            img_path = os.path.join(class_dir, f'img_{img_id}.jpg')
            img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
            img = Image.fromarray(img_array)
            img.save(img_path)

# Create INAT dataset structure
inat_dir = tempfile.mkdtemp()
os.makedirs(os.path.join(inat_dir, '0', '0'), exist_ok=True)

# Create a dummy image for INAT
img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
img = Image.fromarray(img_array)
img.save(os.path.join(inat_dir, '0', '0', 'dummy.jpg'))

# Create INAT JSON files
train2018_data = {
    'images': [
        {
            'id': 0,
            'file_name': '0/0/dummy.jpg'
        }
    ],
    'annotations': [
        {
            'id': 0,
            'image_id': 0,
            'category_id': 0
        }
    ]
}

val2018_data = {
    'images': [
        {
            'id': 1,
            'file_name': '0/0/dummy.jpg'
        }
    ],
    'annotations': []
}

categories_data = [
    {
        'id': 0,
        'name': 'category_0',
        'supercategory': 'super_0'
    }
]

with open(os.path.join(inat_dir, 'train2018.json'), 'w') as f:
    json.dump(train2018_data, f)

with open(os.path.join(inat_dir, 'val2018.json'), 'w') as f:
    json.dump(val2018_data, f)

with open(os.path.join(inat_dir, 'train2019.json'), 'w') as f:
    json.dump(train2018_data, f)

with open(os.path.join(inat_dir, 'val2019.json'), 'w') as f:
    json.dump(val2018_data, f)

with open(os.path.join(inat_dir, 'categories.json'), 'w') as f:
    json.dump(categories_data, f)

# Create args object
class Args:
    def __init__(self):
        self.input_size = 224
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5'
        self.train_interpolation = 'bicubic'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 1
        self.crop_pct = 0.875
        self.data_set = 'IMNET'
        self.data_path = temp_dir
        self.inat_category = 'name'

ARGS = {
    'is_train': True,
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, timm, 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: none by the harness; any seed is in the setup block
build_transform Ran
ran on a synthesized input
sldgroup/mobilevig/util/datasets.py
code served (permissive licence) · get_code("0fbc07d6adfcd855")
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 Compose. 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 torchvision import transforms
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self):
        self.input_size = 224
        self.color_jitter = 0.4
        self.aa = "rand-m9-mstd0.5"
        self.train_interpolation = "bicubic"
        self.reprob = 0.25
        self.remode = "pixel"
        self.recount = 2
        self.crop_pct = 0.875

args = ArgsConfig()

ARGS = {
    "is_train": True,
    "args": args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, timm, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 1 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.

FunctionAlso present inEarliest-datedOthers named
build_dataset 1 other paper
1 later
2601.15888 (2026-01)
Understanding the Transfer Limits of Vision Foundation Models

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

Traditionally, convolutional neural networks (CNN) and vision transformers (ViT) have dominated computer vision. However, recently proposed vision graph neural networks (ViG) provide a new avenue for exploration. Unfortunately, for mobile applications, ViGs are computationally expensive due to the overhead of representing images as graph structures. In this work, we propose a new graph-based sparse attention mechanism, Sparse Vision Graph Attention (SVGA), that is designed for ViGs running on mobile devices. Additionally, we propose the first hybrid CNN-GNN architecture for vision tasks on mobile devices, MobileViG, which uses SVGA. Extensive experiments show that MobileViG beats existing ViG models and existing mobile CNN and ViT architectures in terms of accuracy and/or speed on image classification, object detection, and instance segmentation tasks. Our fastest model, MobileViG-Ti, achieves 75.7% top-1 accuracy on ImageNet-1K with 0.78 ms inference latency on iPhone 13 Mini NPU (compiled with CoreML), which is faster than MobileNetV2x1.4 (1.02 ms, 74.7% top-1) and MobileNetV2x1.0 (0.81 ms, 71.8% top-1). Our largest model, MobileViG-B obtains 82.6% top-1 accuracy with only 2.30 ms latency, which is faster and more accurate than the similarly sized EfficientFormer-L3 model (2.77 ms, 82.4%). Our work proves that well designed hybrid CNN-GNN architectures can be a new avenue of exploration for designing models that are extremely fast and accurate on mobile devices. Our code is publicly available at https://github.com/SLDGroup/MobileViG.

For agents

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

get_harvested_code_for_paper("2307.00395")
get_code_for_paper("2307.00395")
have("2307.00395")

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

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

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

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

Connect an agent — have() is free.