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.

Metadata

Release files for fbscatnet 1.2.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.2.0
File Size Uploaded
fbscatnet-1.2.0.tar.gz 255.1 kB Details

Built distribution (wheel)

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

Total release size: 271.0 kB

Release files / fbscatnet-1.2.0.tar.gz

Download URL fbscatnet-1.2.0.tar.gz
Size 255.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2ffdd73b9243a619a155f4a129a16432327e859dea4c4af51d0e3314c36dcec1
BLAKE2b-256 checksum
How to use checksums
8f552a3a4621f2bc367e0b84629b9dca620f0e979bb6943ab9189fcbe9c879ba
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 Oct 7, 2026.

Transparency log

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

Download URL fbscatnet-1.2.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94f69119dc810003ea2c5c91dda8b4fb7aa4819821029c980aea3f3be33663a6
BLAKE2b-256 checksum
How to use checksums
a96cad34a4d381aa8e58d662136f0f17a97690d4e578a3e3da81ca095dba1009
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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

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