Skip to main content

fbscatnet

PyPI version Python Versions License: MIT CI Coverage Code style: ruff

fbscatnet is a high-performance Python library for computing Fourier-Bessel wavelet scattering transforms. It generates robust, feature embeddings from 2D images, making it an ideal feature extractor for computer vision, biomedical imaging, and physics-based machine learning. This is a brand new project of mine that I have been working on for some time. I would love any criticism, improvements, corrections to both the code and the maths.

Features

  • Novel Wavelet: New wavelet relying on Bessel basis functions.
  • Hardware Accelerated: Seamlessly switch between multi-core CPU execution (scipy/joblib) and GPU acceleration (cupy).
  • Highly Optimized: Vectorised filtering in the frequency domain for maximum throughput across large image batches.
  • ML-Ready: Outputs flattened feature arrays directly compatible with scikit-learn, xgboost, or pytorch.

Installation

Install the base package (CPU-only) via pip:

pip install fbscatnet

To enable GPU acceleration, install with the gpu extra (requires a CUDA-compatible GPU):

pip install fbscatnet[gpu]

Quickstart

Extracting features from a dataset takes just a few lines of code:

import numpy as np
import logging
from fbscatnet import FourierBesselWaveletBank, ScatNet, logger_config
logger_config.enable_colored_logs(logging.DEBUG) # IMPORTANT: SET TO SEE LOGS

# 1. Create some dummy image data (e.g., 10 grayscale images of size 64x64)
images = np.random.rand(10, 64, 64)

# 2. Instantiate a Fourier-Bessel Wavelet Bank
# size: spatial dimension (64x64), m: angular order, k: radial roots
bank = FourierBesselWaveletBank(size=64, m=2, k=2, sigma=0.1)

# 3. Initialize the Scattering Network
# Use backend="gpu" if you installed with CuPy
net = ScatNet(bank=bank, backend="cpu")

# 4. Generate feature embeddings
# downsize: spatial pooling factor (must evenly divide the image size)
features = net.generate_embeddings(images, downsize=4, use_multiprocessing=True)

print(f"Generated embeddings shape: {features.shape}")
# Output: (10, feature_dimension)

Visualising Wavelet Maps

If you want to inspect how the wavelet filters are interacting with your image at the first scattering order, fbscatnet includes a built-in plotting tool:

# Pass a single 2D image to visualize
single_image = images[0]
net.visualise_maps(single_image, downsize=4)

API Overview

Sphinx documentation at: https://smee18.github.io/FourierBesselWavelets/

The example folder also contains a full pipeline, classifying MNIST using the library The pdf of my notes taken along this project contains an in-depth explanation of the mathematics behind these wavelets. Here you can find all derivations, proofs and useful information. Some stuff might seem trivial but my goal is to really expose all aspects so anyone new to wavelet theory can understand the mathematics behind these Fourier Bessel wavelets.

License

This project is licensed under the MIT License.

Metadata

Release files for fbscatnet 1.4.1

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

Source distribution (sdist)

Source distribution for fbscatnet 1.4.1
File Size Uploaded Provenance Actions
fbscatnet-1.4.1.tar.gz 223.8 kB With provenance Details for fbscatnet-1.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 241.9 kB

Release files / fbscatnet-1.4.1.tar.gz

Download URL fbscatnet-1.4.1.tar.gz
Size 223.8 kB
Tags Source
SHA-256 checksum
How to use checksums
28b846e3f4c617668a668c581487f58f5da07012b84cf1569cdc83c4460b6048
BLAKE2b-256 checksum
How to use checksums
bec83aa2d9e2758a371e7eab5534e98d4f4ca287cc4aac010a68153c73cb3e91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / fbscatnet-1.4.1-py3-none-any.whl

Download URL fbscatnet-1.4.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4928ec472dfb7133f333c5849607b45dad7068385ed6a93364c2c24b028023ac
BLAKE2b-256 checksum
How to use checksums
a8e1bfdff1d870dffd4944b1c57eecbf10f0d8f893fb40b5613feadd596febc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for fbscatnet 1.4.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fbscatnet-1.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

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