Skip to main content

metaclean-vlm

Remove metadata from image datasets before VLM training or ingestion to reduce hidden prompt injection risk.

PyPI License: MPL-2.0

Installation

pip install metaclean-vlm

Usage

from metaclean_vlm import clean_images

report = clean_images("raw_images", "clean_images")
print(report)

Bulk clean a dataset

from metaclean_vlm import clean_dataset

report = clean_dataset("dataset/raw", "dataset/clean")
print(report)

clean_dataset recursively processes supported images and preserves folder structure.

Output

[
    {
        "input": "raw_images/example.jpg",
        "output": "clean_images/example.jpg",
        "format": "JPEG",
        "metadata_found": True,
        "metadata_keys": ["exif", "icc_profile"],
        "ok": True,
        "error": None,
    }
]

Clean one image

from metaclean_vlm import clean_image

result = clean_image("image.jpg", "image.clean.jpg")
print(result)

Inspect metadata

from metaclean_vlm import inspect_metadata

metadata = inspect_metadata("image.jpg")
print(metadata)

Overview

metaclean-vlm is a tiny Python utility for removing metadata from image datasets before they are used in VLM pipelines. It is aimed at reducing the risk of hidden prompt injection or unwanted instructions stored in image metadata.

It is useful when building:

  • VLM training datasets
  • multimodal AI pipelines
  • image ingestion systems
  • dataset cleaning workflows
  • AI safety preprocessing tools

Features

  • Removes common image metadata
  • Cleans batches and full image datasets
  • Supports JPEG, PNG, WEBP, TIFF, and BMP
  • Preserves folder structure
  • Returns a simple cleaning report
  • Uses Pillow
  • Simple API

Limitations

metaclean-vlm removes metadata by re-encoding image pixels without metadata fields. It is not a complete security scanner and does not protect against steganography, visible prompt injection, OCR-based attacks, adversarial images, poisoned pixels, or malicious image content. Use it as one dataset hygiene layer, not as your only security control.

Issues

Report issues at: https://github.com/edujbarrios/metaclean-vlm

Author

Eduardo J. Barrios
edujbarrios@outlook.com

License

Mozilla Public License 2.0

Release files for metaclean-vlm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metaclean-vlm 0.1.0
File Size Uploaded
metaclean_vlm-0.1.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metaclean-vlm 0.1.0
File Interpreter ABI Platform
metaclean_vlm-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / metaclean_vlm-0.1.0.tar.gz

Download URL metaclean_vlm-0.1.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fbc3912c89b63d9bb3123ea9b9d6f3176fc15a438eaa2c294721458576bb53f9
BLAKE2b-256 checksum
How to use checksums
649ea961f736e72886134f10a7a943d9e45bce8be4dca59d1c4f66b250fec703
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / metaclean_vlm-0.1.0-py3-none-any.whl

Download URL metaclean_vlm-0.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b263f701d8d67a966472cbde4ccbf985ab402162d03db0a7f1e0525d66eac87
BLAKE2b-256 checksum
How to use checksums
2cc209446b7d3416d693f66e7684acb94a0b4d083baafa3785cb9a44657bbbc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page