SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.03452 · 2023

Multimodal Guidance Network for Missing-Modality Inference in Content Moderation

arXiv · PDF · Open in the Atlas

Code that ran

4 of 10 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 0 have no contract verdict; 4 failures of our instrument; 6 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/2309.03452.json · badge: /api/ran/2309.03452.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
zhuokaizhao/multimodal-guidance-network canonical (classifier label)
classifier basis: census
4 ran · 6 no recorded run
FunctionStatusWhere it lives
load_data_for_testing Ran
ran; our contract draft was wrong, not the code
zhuokaizhao/multimodal-guidance-network/CLIP/vl_dataset.py
code served (permissive licence) · get_code("ea664c7167d26a47")
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 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 os
import cv2
import glob
import torch
import numpy as np
from PIL import Image
import torchvision.transforms as transforms
from unittest.mock import MagicMock
import tempfile
import shutil

torch.manual_seed(0)

# Create a temporary directory structure with test images and texts
test_dir = tempfile.mkdtemp()
os.makedirs(os.path.join(test_dir, 'game'), exist_ok=True)
os.makedirs(os.path.join(test_dir, 'violative'), exist_ok=True)

# Create dummy PNG images and corresponding text files
for i in range(2):
    # Create game image
    game_img = np.random.randint(0, 255, (64, 64, 3), dtype=np.uint8)
    game_img_path = os.path.join(test_dir, 'game', f'game_{i}.png')
    cv2.imwrite(game_img_path, game_img)
    with open(game_img_path.replace('.png', '.txt'), 'w') as f:
        f.write(f"This is game text {i}")
    
    # Create violative image
    violative_img = np.random.randint(0, 255, (64, 64, 3), dtype=np.uint8)
    violative_img_path = os.path.join(test_dir, 'violative', f'violative_{i}.png')
    cv2.imwrite(violative_img_path, violative_img)
    with open(violative_img_path.replace('.png', '.txt'), 'w') as f:
        f.write(f"This is violative text {i}")

# Create a mock tokenizer
class MockTokenizer:
    def encode_plus(self, text, padding=None, truncation=None, max_length=None, 
                    return_token_type_ids=False, return_attention_mask=False, return_tensors=None):
        batch_size = 1
        seq_len = max_length if max_length else 10
        return {
            'input_ids': torch.randint(0, 100, (batch_size, seq_len)),
            'attention_mask': torch.ones((batch_size, seq_len)),
            'token_type_ids': torch.zeros((batch_size, seq_len), dtype=torch.long)
        }

mock_tokenizer = MockTokenizer()

# Mock the get_tokenizer_settings function
def get_tokenizer_settings(text_encoder_name):
    return (mock_tokenizer, 121)

# Make get_tokenizer_settings available in the module
import sys
sys.modules[__name__].get_tokenizer_settings = get_tokenizer_settings

ARGS = {
    'test_dir': test_dir,
    'batch_size': 2,
    'text_encoder_name': 'distilbert'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, 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, 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
load_data_for_training Ran
ran; our contract draft was wrong, not the code
zhuokaizhao/multimodal-guidance-network/CLIP/vl_dataset.py
code served (permissive licence) · get_code("31fc31433de953de")
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 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 os
import tempfile
import torch
import numpy as np
from PIL import Image
import cv2

torch.manual_seed(0)

# Create temporary directories with test data
temp_train_dir = tempfile.mkdtemp()
temp_val_dir = tempfile.mkdtemp()

# Create subdirectories for game and violative labels
os.makedirs(os.path.join(temp_train_dir, 'game'), exist_ok=True)
os.makedirs(os.path.join(temp_train_dir, 'violative'), exist_ok=True)
os.makedirs(os.path.join(temp_val_dir, 'game'), exist_ok=True)
os.makedirs(os.path.join(temp_val_dir, 'violative'), exist_ok=True)

# Create dummy PNG images and corresponding text files
def create_dummy_data(base_dir, num_per_class=2):
    for class_name in ['game', 'violative']:
        class_dir = os.path.join(base_dir, class_name)
        for i in range(num_per_class):
            # Create a small dummy PNG image (4x3 RGB)
            img_array = np.random.randint(0, 255, (4, 3, 3), dtype=np.uint8)
            img_path = os.path.join(class_dir, f'{class_name}_{i}.png')
            cv2.imwrite(img_path, img_array)
            
            # Create corresponding text file
            txt_path = img_path.replace('.png', '.txt')
            with open(txt_path, 'w') as f:
                f.write(f"Sample text for {class_name} {i}")

create_dummy_data(temp_train_dir, num_per_class=2)
create_dummy_data(temp_val_dir, num_per_class=2)

# Create a mock tokenizer class
class MockTokenizer:
    def encode_plus(self, text, padding=None, truncation=None, max_length=None, 
                    return_token_type_ids=False, return_attention_mask=False, 
                    return_tensors=None):
        batch_size = 1
        result = {
            'input_ids': torch.randint(0, 1000, (batch_size, max_length or 121)),
            'attention_mask': torch.ones((batch_size, max_length or 121)),
        }
        if return_token_type_ids:
            result['token_type_ids'] = torch.zeros((batch_size, max_length or 121), dtype=torch.long)
        return result

# Create mock get_tokenizer_settings function
def get_tokenizer_settings(text_encoder_name):
    tokenizer = MockTokenizer()
    max_len = 121
    return tokenizer, max_len

ARGS = {
    'train_dir': temp_train_dir,
    'val_dir': temp_val_dir,
    'batch_size': 2,
    'text_encoder_name': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, cv2, 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, 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
load_model Ran
ran; our contract draft was wrong, not the code
zhuokaizhao/multimodal-guidance-network/MobileOne/finetune_mobileone_single.py
code served (permissive licence) · get_code("83c7619610642884")
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 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 torch
import torch.nn as nn
from collections import defaultdict

# Define a minimal model that satisfies the function's usage
class MockMobileOneModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 64, 3)
        self.linear = nn.Linear(1024, 10)  # Will be replaced by load_model
    
    def forward(self, x):
        return self.linear(self.conv(x))
    
    def load_state_dict(self, state_dict, strict=True):
        # Mock load_state_dict that accepts any dict
        pass

torch.manual_seed(0)

# Create a mock model instance
model = MockMobileOneModel()

# Create a mock checkpoint with required keys
checkpoint_dict = {
    'model_state_dict': {'linear.weight': torch.randn(2, 1024), 'linear.bias': torch.randn(2)},
    'num_epoch': 5,
    'history': defaultdict(list)
}

ARGS = {
    'model': model,
    'model_type': 's0',
    'load_pretrain': False,
    'checkpoint_path': None
}
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 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
reparameterize_model Ran
ran; our contract draft was wrong, not the code
zhuokaizhao/multimodal-guidance-network/vl_model/mobileone.py
code served (permissive licence) · get_code("26d8eb2d92c74ef9")
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 SimpleModel. 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 copy
import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple reparameterizable module
class ReparameterizableBlock(nn.Module):
    def __init__(self):
        super().__init__()
        self.branch1 = nn.Conv2d(3, 4, kernel_size=1)
        self.branch2 = nn.Conv2d(3, 4, kernel_size=3, padding=1)
        self.fused_conv = None
        self._reparameterized = False
    
    def forward(self, x):
        if self._reparameterized:
            return self.fused_conv(x)
        return self.branch1(x) + self.branch2(x)
    
    def reparameterize(self):
        # Simulate reparameterization by fusing branches
        if not self._reparameterized:
            self.fused_conv = nn.Conv2d(3, 4, kernel_size=3, padding=1)
            self._reparameterized = True

# Create a simple model that contains reparameterizable modules
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.block1 = ReparameterizableBlock()
        self.block2 = ReparameterizableBlock()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        x = self.block1(x)
        x = self.block2(x)
        return x

# Create a model instance
model = SimpleModel()

# Define the ARGS dictionary
ARGS = {
    "model": model
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
get_tokenizer_settings Not yet run
unverified (harvested, no recorded run)
zhuokaizhao/multimodal-guidance-network/vl_model/vl_dateset.py
code served (permissive licence) · get_code("546d4f4b91ff8133")
How it ran

no invocation recorded.

load_data_for_testing Not yet run
unverified (harvested, no recorded run)
zhuokaizhao/multimodal-guidance-network/vl_model/vl_dateset.py
code served (permissive licence) · get_code("46ce8ca40f317139")
How it ran

no invocation recorded.

load_data_for_training Not yet run
unverified (harvested, no recorded run)
zhuokaizhao/multimodal-guidance-network/vl_model/vl_dateset.py
code served (permissive licence) · get_code("400aef55175bd438")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
zhuokaizhao/multimodal-guidance-network/MobileOne/finetune_mobileone.py
code served (permissive licence) · get_code("e4a846c5456a0af7")
How it ran

no invocation recorded.

mobileone Not yet run
unverified (harvested, no recorded run)
zhuokaizhao/multimodal-guidance-network/MobileOne/mobileone.py
code served (permissive licence) · get_code("c530aa04420eb8d2")
How it ran

no invocation recorded.

mobileone_encoder Not yet run
unverified (harvested, no recorded run)
zhuokaizhao/multimodal-guidance-network/vl_model/mobileone.py
code served (permissive licence) · get_code("a450e5652620e756")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
reparameterize_model 3 other papers
2 dated earlier, 1 later
2203.03339 (2022-03)
L2CS-Net: Fine-Grained Gaze Estimation in Unconstrained Environments
2206.04040 (2022-06)
MobileOne: An Improved One millisecond Mobile Backbone
2406.05850 (2024-06)
Scaling Graph Convolutions for Mobile Vision
mobileone 1 other paper
1 dated earlier
2206.04040 (2022-06)
MobileOne: An Improved One millisecond Mobile Backbone

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

Multimodal deep learning, especially vision-language models, have gained significant traction in recent years, greatly improving performance on many downstream tasks, including content moderation and violence detection. However, standard multimodal approaches often assume consistent modalities between training and inference, limiting applications in many real-world use cases, as some modalities may not be available during inference. While existing research mitigates this problem through reconstructing the missing modalities, they unavoidably increase unnecessary computational cost, which could be just as critical, especially for large, deployed infrastructures in industry. To this end, we propose a novel guidance network that promotes knowledge sharing during training, taking advantage of the multimodal representations to train better single-modality models to be used for inference. Real-world experiments in violence detection shows that our proposed framework trains single-modality models that significantly outperform traditionally trained counterparts, while avoiding increases in computational cost for inference.

For agents

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

get_harvested_code_for_paper("2309.03452")
get_code_for_paper("2309.03452")
have("2309.03452")

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

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

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

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

Connect an agent — have() is free.