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, FourierBesselScatNet, 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 = FourierBesselScatNet(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.

Release files for fbscatnet 1.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 fbscatnet 1.1.0
File Size Uploaded
fbscatnet-1.1.0.tar.gz 255.2 kB Details

Built distribution (wheel)

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

Total release size: 271.1 kB

Release files / fbscatnet-1.1.0.tar.gz

Download URL fbscatnet-1.1.0.tar.gz
Size 255.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9d363034c754dcc8505bc9b046f645cb03a1827c87b06bf52a6df25479181a79
BLAKE2b-256 checksum
How to use checksums
14a44205a78e0faf728fa501ef19fb71068b1aa537edef11c6f2a8f875b017cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 11, 2026.

Transparency log

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

Download URL fbscatnet-1.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bae90fae58d3a81a38ff8b8839d3b46b593e91904feafcd1c7432f9b081aaf8
BLAKE2b-256 checksum
How to use checksums
fe005d463680ac481b234af273e135dc1ae964a7aad500506b17c0ff7020d2be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.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