SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.16211 · ICLR · 2024

VDC: Versatile Data Cleanser based on Visual-Linguistic Inconsistency by Multimodal Large Language Models

Baoyuan Wu, Bingzhe Wu, Mingda Zhang, Zihao Zhu, Shaokui Wei

arXiv · PDF · Open in the Atlas

Code that ran

8 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 3 failures of our instrument; 9 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/2309.16211.json · badge: /api/ran/2309.16211.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
zihao-ai/vdc canonical (classifier label)
classifier basis: classifier_2025
8 ran · 9 no recorded run
FunctionStatusWhere it lives
ImageTextPair Ran
ran on a synthesized input · constructed an object; no result was computed
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("db733d746340ae5a")
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 an instance of its own class, ImageTextPair: the run constructed the object and did not call it, so no result was computed. 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 dataclasses import dataclass
from typing import List, Optional

@dataclass
class QAPair:
    """存储问答对的数据类"""
    question: str
    expected_answer: str
    actual_answer: Optional[str] = None
    is_matched: Optional[bool] = None

class BaseDataPair:
    """数据对的基类"""

    def __init__(self, text: str):
        self.text: str = text
        self.qa_pairs: List[QAPair] = []
        self.consistency_score: float = 0.0
        self.is_consistent: Optional[bool] = None

    def add_qa_pair(self, question: str, expected_answer: str):
        """添加一个问答对"""
        self.qa_pairs.append(QAPair(question=question, expected_answer=expected_answer))

    def update_qa_result(self, index: int, actual_answer: str, is_matched: bool):
        """更新问答结果"""
        if 0 <= index < len(self.qa_pairs):
            self.qa_pairs[index].actual_answer = actual_answer
            self.qa_pairs[index].is_matched = is_matched

    def calculate_consistency_score(self):
        """计算一致性得分"""
        if not self.qa_pairs:
            return 0.0
        matched_count = sum((1 for qa in self.qa_pairs if qa.is_matched))
        self.consistency_score = matched_count / len(self.qa_pairs)
        return self.consistency_score

    def is_consistent(self, threshold: float=0.5):
        """判断是否一致"""
        self.is_consistent = self.consistency_score >= threshold
        return self.is_consistent

class ImageTextPair(BaseDataPair):
    """图文对类,用于存储和处理图文对数据"""

    def __init__(self, img_path: str, text: str):
        super().__init__(text)
        self.img_path: str = img_path

    def __str__(self):
        s = f'Image_path={self.img_path}, text={self.text}'
        for i, qa in enumerate(self.qa_pairs):
            s += f'\n{i + 1}. Question: {qa.question}\nExpected Answer: {qa.expected_answer}\nActual Answer: {qa.actual_answer}\nMatched: {qa.is_matched}\n'
        s += f'\nConsistency Score: {self.consistency_score}\nIs Consistent: {self.is_consistent}'
        return s

    def __repr__(self):
        return self.__str__()

ARGS = {
    "img_path": "/path/to/image.jpg",
    "text": "This is a sample image text description."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ImageTextPair — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ImageTextPair 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
QAPair Ran
ran on a synthesized input · constructed an object; no result was computed
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("74776e27896ffb46")
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 an instance of its own class, QAPair: the run constructed the object and did not call it, so no result was computed. 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
from typing import Optional, Union, Tuple
from dataclasses import dataclass

@dataclass
class QAPair:
    """存储问答对的数据类"""
    question: str
    expected_answer: str
    actual_answer: Optional[str] = None
    is_matched: Optional[bool] = None

torch.manual_seed(0)

ARGS = {
    "question": "What is the capital of France?",
    "expected_answer": "Paris",
    "actual_answer": "Paris",
    "is_matched": True
}
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 QAPair — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a QAPair 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
VDCConfig Ran
ran on a synthesized input · constructed an object; no result was computed
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("30a82bb00f9fb340")
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 an instance of its own class, VDCConfig: the run constructed the object and did not call it, so no result was computed. 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 os
from dataclasses import dataclass

@dataclass
class VDCConfig:
    """配置类"""
    llm_base_url: str
    llm_api_key: str
    mllm_base_url: str
    mllm_api_key: str
    llm_model: str = 'gpt-4'
    mllm_model: str = 'gpt-4-vision-preview'

    @staticmethod
    def from_env():
        """从环境变量中读取配置"""
        return VDCConfig(llm_base_url=os.getenv('VDC_LLM_BASE_URL'), llm_api_key=os.getenv('VDC_LLM_API_KEY'), mllm_base_url=os.getenv('VDC_MLLM_BASE_URL'), mllm_api_key=os.getenv('VDC_MLLM_API_KEY'), llm_model=os.getenv('VDC_LLM_MODEL', 'gpt-4'), mllm_model=os.getenv('VDC_MLLM_MODEL', 'gpt-4-vision-preview'))

    def validate(self):
        """验证配置是否完整"""
        required_vars = {'VDC_LLM_BASE_URL': self.llm_base_url, 'VDC_LLM_API_KEY': self.llm_api_key, 'VDC_MLLM_BASE_URL': self.mllm_base_url, 'VDC_MLLM_API_KEY': self.mllm_api_key}
        missing_vars = [var for var, value in required_vars.items() if not value]
        if missing_vars:
            raise ValueError(f"Missing required environment variables: {', '.join(missing_vars)}")

ARGS = {
    'llm_base_url': 'https://api.openai.com/v1',
    'llm_api_key': 'sk-test-key-llm-12345',
    'mllm_base_url': 'https://api.openai.com/v1',
    'mllm_api_key': 'sk-test-key-mllm-12345',
    'llm_model': 'gpt-4',
    'mllm_model': 'gpt-4-vision-preview'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 VDCConfig — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VDCConfig 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
VideoBatchQAPrompt Ran
ran on a synthesized input
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("703d30e5d1885cc9")
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 str. 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 torch import nn

INIT_ARGS = {}

ARGS = {
    "questions": [
        "Is there a person visible in the first frame?",
        "Does the person raise their hand within the first 5 seconds?"
    ]
}

# Since VideoBatchQAPrompt has no __init__ and only a static method,
# we call it directly without instantiation.
# The following is the setup to demonstrate calling the static method.
METHOD = "format"
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
VideoTextPair Ran
ran on a synthesized input · constructed an object; no result was computed
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("8dfe3ce2161c4e7e")
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 an instance of its own class, VideoTextPair: the run constructed the object and did not call it, so no result was computed. 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 dataclasses import dataclass
from typing import Optional, List

@dataclass
class QAPair:
    """存储问答对的数据类"""
    question: str
    expected_answer: str
    actual_answer: Optional[str] = None
    is_matched: Optional[bool] = None

class BaseDataPair:
    """数据对的基类"""

    def __init__(self, text: str):
        self.text: str = text
        self.qa_pairs: List[QAPair] = []
        self.consistency_score: float = 0.0
        self.is_consistent: Optional[bool] = None

    def add_qa_pair(self, question: str, expected_answer: str):
        """添加一个问答对"""
        self.qa_pairs.append(QAPair(question=question, expected_answer=expected_answer))

    def update_qa_result(self, index: int, actual_answer: str, is_matched: bool):
        """更新问答结果"""
        if 0 <= index < len(self.qa_pairs):
            self.qa_pairs[index].actual_answer = actual_answer
            self.qa_pairs[index].is_matched = is_matched

    def calculate_consistency_score(self):
        """计算一致性得分"""
        if not self.qa_pairs:
            return 0.0
        matched_count = sum((1 for qa in self.qa_pairs if qa.is_matched))
        self.consistency_score = matched_count / len(self.qa_pairs)
        return self.consistency_score

    def is_consistent(self, threshold: float=0.5):
        """判断是否一致"""
        self.is_consistent = self.consistency_score >= threshold
        return self.is_consistent

class VideoTextPair(BaseDataPair):
    """视频文本对类,用于存储和处理视频文本对数据"""

    def __init__(self, video_path: str, text: str):
        super().__init__(text)
        self.video_path: str = video_path

ARGS = {
    "video_path": "/path/to/video.mp4",
    "text": "This is a sample video description text for testing purposes."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type VideoTextPair — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VideoTextPair 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
encode_image Ran
ran; our contract draft was wrong, not the code
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("b5fa7736e0dfb6df")
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 str. 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 base64
import tempfile
import os

# Create a temporary image file for testing
with tempfile.NamedTemporaryFile(mode='wb', suffix='.png', delete=False) as tmp_file:
    # Write minimal PNG data (1x1 transparent pixel)
    png_data = (
        b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01'
        b'\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\nIDATx\x9cc\x00\x01'
        b'\x00\x00\x05\x00\x01\r\n-\xb4\x00\x00\x00\x00IEND\xaeB`\x82'
    )
    tmp_file.write(png_data)
    image_path = tmp_file.name

ARGS = {
    'image_path': image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
generate_text Ran
ran; our contract draft was wrong, not the code
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("b3a3983654d23cc7")
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 str. 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 openai

# Mock the OpenAI client and response to avoid actual API calls
class MockMessage:
    def __init__(self):
        self.content = "This is a generated response from the mock model."

class MockChoice:
    def __init__(self):
        self.message = MockMessage()

class MockResponse:
    def __init__(self):
        self.choices = [MockChoice()]

class MockCompletions:
    def create(self, model, messages, temperature, max_tokens, top_p):
        return MockResponse()

class MockChatCompletions:
    def __init__(self):
        self.completions = MockCompletions()

class MockOpenAIClient:
    def __init__(self, base_url, api_key):
        self.base_url = base_url
        self.api_key = api_key
        self.chat = MockChatCompletions()

# Patch openai.OpenAI to use our mock
openai.OpenAI = MockOpenAIClient

ARGS = {
    'base_url': 'http://localhost:8000/v1',
    'api_key': 'sk-test-key-12345',
    'model': 'gpt-3.5-turbo',
    'prompt': 'What is machine learning?'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_mime_type Ran
ran; our contract draft was wrong, not the code
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("4dca5b7c93dadb0a")
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 str. 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 os

def get_mime_type(file_path: str) -> str:
    """根据文件扩展名获取MIME类型"""
    ext = os.path.splitext(file_path)[1].lower()
    mime_types = {'.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.gif': 'image/gif', '.webp': 'image/webp'}
    return mime_types.get(ext, 'image/jpeg')


ARGS = {
    'file_path': 'image.png'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
BaseDataPair Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("f1f52fedd5594d5b")
How it ran

no invocation recorded.

DataCleanser Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("40604a123d40ea11")
How it ran

no invocation recorded.

ImageBatchQAPrompt Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("8fe89a9b67ae22f6")
How it ran

no invocation recorded.

ImageQAPrompt Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("97a96bf65e202f18")
How it ran

no invocation recorded.

ImageQGPrompt Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("a8cf3b67773ddbdb")
How it ran

no invocation recorded.

VideoQAPrompt Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("3ad0967f34a83055")
How it ran

no invocation recorded.

VideoQGPrompt Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("87e17a9fd46db8ad")
How it ran

no invocation recorded.

generate_text_with_images Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("25ce289971b5fced")
How it ran

no invocation recorded.

generate_text_with_video Not yet run
unverified (harvested, no recorded run)
zihao-ai/vdc/vdc/cleanser.py
code served (permissive licence) · get_code("b87180285f8c51b8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 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 16 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
encode_image
brick of this paper's assembly: helper
2 other papers
2 later
2505.17908 (2025-05)
ComfyMind: Toward General-Purpose Generation via Tree-Based Planning and Reactive Feedback
2606.10403 (2026-06)
KCSAT-ML: Probing Reasoning Models with Nationwide-Cohort Human Difficulty

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

The role of data in building AI systems has recently been emphasized by the emerging concept of data-centric AI. Unfortunately, in the real-world, datasets may contain dirty samples, such as poisoned samples from backdoor attack, noisy labels in crowdsourcing, and even hybrids of them. The presence of such dirty samples makes the DNNs vunerable and unreliable. Hence, it is critical to detect dirty samples to improve the quality and realiability of dataset. Existing detectors only focus on detecting poisoned samples or noisy labels, that are often prone to weak generalization when dealing with dirty samples from other fields. In this paper, we find a commonality of various dirty samples is visual-linguistic inconsistency between images and associated labels. To capture the semantic inconsistency between modalities, we propose versatile data cleanser (VDC) leveraging the surpassing capabilities of multimodal large language models (MLLM) in cross-modal alignment and reasoning. It consists of three consecutive modules: the visual question generation module to generate insightful questions about the image; the visual question answering module to acquire the semantics of the visual content by answering the questions with MLLM; followed by the visual answer evaluation module to evaluate the inconsistency. Extensive experiments demonstrate its superior performance and generalization to various categories and types of dirty samples. The code is available at https://github.com/zihao-ai/vdc.

For agents

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

get_harvested_code_for_paper("2309.16211")
get_code_for_paper("2309.16211")
have("2309.16211")

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

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

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

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

Connect an agent — have() is free.