Skip to main content

ISCC - Semantic Image-Code

Tests Version Downloads

iscc-sci is a proof of concept implementation of a semantic Image-Code for the ISCC (International Standard Content Code). Semantic Image-Codes are designed to capture and represent the semantic content of images for improved similarity detection.

What is ISCC Semantic Image-Code

The ISCC framework already comes with an Image-Code that is based on perceptual hashing and can match near duplicates. The ISCC Semantic Image-Code is planned as a new additional ISCC-UNIT focused on capturing a more abstract and broad semantic similarity. As such the Semantic Image-Code is engineered to be robust against a broader range of variations that cannot be matched with the perceptual Image-Code.

Features

  • Semantic Similarity: Leverages deep learning models to generate codes that reflect the semantic content of images.
  • Bit-Length Flexibility: Supports generating codes of various bit lengths (up to 256 bits), allowing for adjustable granularity in similarity detection.
  • ISCC Compatible: Generates codes that are fully compatible with the ISCC specification, facilitating integration with existing ISCC-based systems.

Installation

Ensure you have Python 3.11 or newer installed on your system. The package requires an ONNX runtime that is selected via install extras. For CPU inference (works everywhere):

pip install "iscc-sci[cpu]"

For NVIDIA CUDA accelerated inference (requires CUDA 12.x and cuDNN 9.x):

pip install "iscc-sci[gpu]"

Usage

To generate a Semantic Image-Code for an image, use the code_image_semantic function. You can specify the bit length of the code to control the level of granularity in the semantic representation.

import iscc_sci as sci

# Generate a 64-bit ISCC Semantic Image-Code for an image file
image_file_path = "path/to/your/image.jpg"
semantic_code = sci.code_image_semantic(image_file_path, bits=64)

print(semantic_code)

How It Works

iscc-sci uses a pre-trained deep learning model based on the 1st Place Solution of the Image Similarity Challenge (ISC21) to create semantic embeddings of images. The model generates a feature vector that captures the essential characteristics of the image. This vector is then binarized to produce a Semantic Image-Code that is robust to variations in image presentation but sensitive to content differences.

Development

This is a proof of concept and welcomes contributions to enhance its capabilities, efficiency, and compatibility with the broader ISCC ecosystem. For development, install the project with uv. The default uv sync installs the test group, which provides a CPU ONNX runtime:

git clone https://github.com/iscc/iscc-sci.git
cd iscc-sci
uv sync

Contributing

Contributions are welcome! If you have suggestions for improvements or bug fixes, please open an issue or pull request. For major changes, please open an issue first to discuss what you would like to change.

Release files for iscc-sci 0.3.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 iscc-sci 0.3.0
File Size Uploaded
iscc_sci-0.3.0.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iscc-sci 0.3.0
File Interpreter ABI Platform
iscc_sci-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.0 kB

Release files / iscc_sci-0.3.0.tar.gz

Download URL iscc_sci-0.3.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
68f85086dccb0e4433a5601f73c66daf8e50e19df8cba4522853a0437283ea79
BLAKE2b-256 checksum
How to use checksums
a2e33c899244e6e04789a1d0af3920b07846e398b25aeb5476f65e97de3841d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / iscc_sci-0.3.0-py3-none-any.whl

Download URL iscc_sci-0.3.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ddf3d50bb078eec9e26bce905c4786a227dd09726d1b802bd880bd4973a37a2
BLAKE2b-256 checksum
How to use checksums
60cd32c16d1b87c47195c8943332705ab3bd29e357f355040bbaa2bf732f84fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

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