Skip to main content

Mithridatium

A framework for verifying the integrity of pretrained AI models

Mithridatium is a research-driven project for detecting potential backdoors and data poisoning behavior in pretrained models. The project provides a modular command-line workflow for loading models, running defenses, and generating structured JSON reports.


Project Overview

Modern ML pipelines often reuse pretrained weights from online repositories.
This comes with risks:

  • Backdoors: models behave normally until triggered by a specific pattern.
  • Data poisoning: compromised training data leading to biased or malicious models.

Mithridatium analyzes pretrained models to flag potential compromises using multiple defenses from academic research.


Web Demo

Try the hosted Streamlit demo on Hugging Face Spaces:

https://huggingface.co/spaces/williamphoenix/Mithridatium

The repository also includes a local Streamlit app:

streamlit run app.py

Documentation

The project documentation has been reorganized under docs/.

Quickstart

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

# Optional extras:
# pip install -e ".[hf]"      # Hugging Face model loading
# pip install -e ".[ui]"      # Streamlit/Gradio UI dependencies
# pip install -e ".[all]"     # Everything for development/demo work

# (A) Train demo models (fast settings)

# Clean model on 5 epochs (Increase epochs for better accuracy, but it will take longer)
python -m scripts.train_resnet18 --dataset clean --epochs 5 --output_path models/resnet18_clean.pth

# Poisoned model on 5 epochs (increase epochs for better accuracy)
python -m scripts.train_resnet18 --dataset poison --train_poison_rate 0.1 --target_class 0 \
  --epochs 5 --output_path models/resnet18_poison.pth

# Invisible-trigger model using a small universal perturbation
python -m scripts.train_resnet18 --dataset invisible --train_poison_rate 0.1 --target_class 0 \
  --uap-norm 2 --uap-xi 0.05 --poison_loss_weight 2.0 \
  --epochs 5 --output_path models/resnet18_invisible.pth

# (B) Run one supported defense (default architecture hint: resnet18)
mithridatium detect --model models/resnet18_poison.pth --defense mmbd --data cifar10 --out reports/mmbd.json

# (B2) Run FreeEagle detection with optional overrides
mithridatium detect --model models/resnet18_poison.pth --defense freeeagle --data cifar10 \
  --freeeagle-anomaly-threshold 2.5 --freeeagle-optimize-steps 100 --out reports/freeeagle.json

# (Optional) Specify architecture (supported: resnet18, resnet34)
mithridatium detect --model models/resnet18_poison.pth --defense mmbd --data cifar10 --arch resnet34 --out reports/mmbd.json

# (C) See report JSON
cat reports/mmbd.json

For more examples, see docs/testing/sample-commands.md.

CLI Help

To see all available options and arguments:

mithridatium detect --help

Defense-specific options are documented in docs/defenses/. Keeping the full CLI help in the command output avoids stale duplicated option lists in this README.

Metadata

Release files for mithridatium 0.1.2

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

Source distribution (sdist)

Source distribution for mithridatium 0.1.2
File Size Uploaded Provenance Actions
mithridatium-0.1.2.tar.gz 43.3 kB Without provenance Details for mithridatium-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mithridatium 0.1.2
File Interpreter ABI Platform Actions
mithridatium-0.1.2-py3-none-any.whl Python 3 none any Details for mithridatium-0.1.2-py3-none-any.whl

Total release size: 93.0 kB

Release files / mithridatium-0.1.2.tar.gz

Download URL mithridatium-0.1.2.tar.gz
Size 43.3 kB
Tags Source
SHA-256 checksum
How to use checksums
da134e466c89691fd40447c90fce437854283d055da2c9af20d83b200edab2b4
BLAKE2b-256 checksum
How to use checksums
22062e25cb24781d0b449669c777a9f0e6d48706de1bf32dde81c0335ca55e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / mithridatium-0.1.2-py3-none-any.whl

Download URL mithridatium-0.1.2-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9df47319733181b1554e86a4f5f384908122b0ee7e8e37ed7efab1c70ca9e321
BLAKE2b-256 checksum
How to use checksums
c11a0942b1827f1c7d7b687c747adc02d529608a702141dcf7ee288f08a22d2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for mithridatium 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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