Skip to main content

PyPI version Commit CI/CD Release CI/CD Documentation Status PyPI downloads Stars Contributors Wheel Status

Last commit

sealwatch

Python package, containing implementations of modern image steganalysis algorithms.

⚠️ This project is under intensive development as we speak.

Installation

Simply install the package with pip3

pip3 install sealwatch

or using the cloned repository

git clone https://github.com/uibk-uncover/sealwatch/
cd sealwatch
pip3 install .

Import to Python by typing

import sealwatch as sw

Contents

Abbreviation Dimensionality Domain Reference Output format
SPAM: subtractive pixel adjacency matrix 686 spatial Reference ordered dict
JRM: JPEG rich model 11255 JPEG Reference ordered dict
CC-JRM: cartesian-calibrated JRM 22510 JPEG Reference ordered dict
DCTR: discrete cosine transform residual features 8000 spatial Reference ordered dict
PHARM: phase-aware projection rich model 12600 JPEG Reference ordered dict
GFR: Gabor filter residual features 17000 JPEG Reference 5D array
SRM: spatial rich models 34671 spatial Reference ordered dict
SRMQ1: SRM with quantization 1 12753 spatial Reference ordered dict
CRM: color rich models 5404 spatial Reference ordered dict

These implementations are based on the Matlab reference implementations provided by the DDE lab at Binghamton University.

Usage

Extract GFR features from a single JPEG image

features = sw.gfr.extract("seal1.jpg")

After having extracted features from cover and stego images, you can train an FLD ensemble as binary classifier.

import numpy as np

Xc_tr, Xs_tr, Xc_te, Xs_te = sw.ensemble_classifier.helpers.load_and_split_features(
    cover_features_filename="cover_features.h5",
    stego_features_filename="stego_features.h5",
    train_csv="train.csv",
    test_csv="test.csv",
)

# Training is faster when arrays are C-contiguous
Xc_tr = np.ascontiguousarray(Xc_tr)
Xs_tr = np.ascontiguousarray(Xs_tr)

# The hyper-parameter search is wrapped inside a trainer class
trainer = sw.ensemble_classifier.FldEnsembleTrainer(
    Xc=Xc_tr,
    Xs=Xs_tr,
    seed=12345,
    verbose=1,
)

# Train with hyper-parameter search
trained_ensemble, training_records = trainer.train()

# Concatenate the test features and labels
X_test = np.concatenate((cover_features_test, stego_features_test), axis=0)
y_test = np.concatenate((
    -np.ones(len(cover_features_test)),
    +np.ones(len(stego_features_test))
), axis=0)

# Calculate test accuracy
test_accuracy = trained_ensemble.score(X_test, y_test)

Feature formats

Note that the feature extractors return different formats: 1D arrays, multi-dimensional arrays, or ordered dicts. The reason is that feature descriptors are composed of multiple submodels. Retaining the structure allows the user to select a specific submodel. The following snippets show how to flatten the features to a 1D array.

Ordered dict

# The PHARM feature extraction returns an ordered dict
features_grouped = sw.pharm.extract_from_file("seal1.jpg", implementation=sw.PHARM_REVISITED)

# Flatten dict to a 1D array
features = sw.tools.flatten(features_grouped)

Multi-dimensional array

# The GFR feature extraction returns a 5-dimensional array:
# - Dimension 0: Phase shifts
# - Dimension 1: Scales
# - Dimension 2: Rotations/Orientations
# - Dimension 3: Number of histograms
# - Dimension 4: Co-occurrences
features = sw.gfr.extract("seal1.jpg")

# Simply flatten to a 1D array
features = features.flatten()

Acknowledgements and Disclaimer

Developed by Martin Benes and Benedikt Lorch, University of Innsbruck, 2024.

The implementations of feature extractors and the detector in this package are based on the original Matlab code provided by the Digital Data Embedding Lab at Binghamton University.

We have made our best effort to ensure that our implementations produce identical results as the original Matlab implementations. However, it is the user's responsibility to verify this. For notes on compatibility with previous implementation, see compatibility.md.

Metadata

Release files for sealwatch 2025.9

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

Source distribution (sdist)

Source distribution for sealwatch 2025.9
File Size Uploaded Provenance
sealwatch-2025.9.tar.gz 40.0 MB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for sealwatch 2025.9
File Interpreter ABI Platform
sealwatch-2025.9-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
sealwatch-2025.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
sealwatch-2025.9-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details

Total release size: 41.0 MB

Release files / sealwatch-2025.9.tar.gz

Download URL sealwatch-2025.9.tar.gz
Size 40.0 MB
Tags Source
SHA-256 checksum
How to use checksums
302f252cae9927afa78096cd9a8d1b6fd1098c6011d245d8b72b3cc635defe45
BLAKE2b-256 checksum
How to use checksums
f6471c2a73e8618b0f3ffa140a0e62ea93b9102c9bb6d43468b093882d8c82a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / sealwatch-2025.9-cp38-abi3-win_amd64.whl

Download URL sealwatch-2025.9-cp38-abi3-win_amd64.whl
Size 252.9 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0bce62f63005a1acb7c2e07b5584389ec627e9e6786edac29d789d954d2e3b8f
BLAKE2b-256 checksum
How to use checksums
4e1667a6c375d8b57d6b495a568ce51a41f7a251f456ea41201b7632ea67e5a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / sealwatch-2025.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sealwatch-2025.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 404.1 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
186a3c62b58fff0627480b30837c404598788c0ed67b7002425394e1fa324ab6
BLAKE2b-256 checksum
How to use checksums
72ee7f5e19fac875794080651ac2a10c2064136b18cd42c01fdd56a025ba0d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / sealwatch-2025.9-cp38-abi3-macosx_11_0_arm64.whl

Download URL sealwatch-2025.9-cp38-abi3-macosx_11_0_arm64.whl
Size 358.9 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
618553c97816e2242bec6fdd129cda0f8f177492d5f60ec49f9fc14ed089835d
BLAKE2b-256 checksum
How to use checksums
d68e5d30af28425e40117088a00ec2d99560cda9b46b97d84606652e27a50bbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Security for sealwatch 2025.9

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