Open source implementation of the uniform discrete curvelet transform in Python.
Project description
Curvelets
[!WARNING] This project is in very early development! Expect bugs!
Getting Started | FAQs | Examples
Getting stated
import numpy as np
from curvelets.numpy import UDCT
x = np.ones((128, 128))
C = UDCT(shape=x.shape)
y = C.forward(x)
np.testing.assert_allclose(x, C.backward(y))
You can use UDCT very similarly to FDCT from curvelops, with a limitation that UDCT only operates arrays whose sizes are powers of 2.
FAQs
0. Should I use this library?
Probably not! This library is a work in progress, pre-alpha library for a very specific version of the curvelet transform known as the Uniform Discrete Curvelet Transform (UDCT).
Consider using other, more mature projects.
| Description | License | N-D? | Invertible? | |
|---|---|---|---|---|
| curvelets | UDCT in Python | MIT | N-D | Exact |
| Curvelab | FDCT in C++ and Matlab | Proprietary (free for academic use only) | 2D, 3D | Exact |
| curvelops | Curvelab Python wrapper | MIT, depedends on Curvelab | 2D, 3D | Exact |
| Kymatio | Wavelet scattering transform | BSD 3-clause | 1D, 2D, 3D | Approximate |
| dtcwt | Dual-Tree Complex Wavelet Transform | Custom BSD 2-clause | 1D, 2D, 3D | Exact |
| Pytorch Wavelets | Discrete WT and Dual-Tree CWT | MIT | 2D | Exact |
1. What even are curvelets?
Curvelets are like wavelets, but in 2D (3D, 4D, etc.). But so are steerable wavelets, Gabor wavelets, wedgelets, beamlets, bandlets, contourlets, shearlets, wave atoms, platelets, surfacelets, ... you get the idea. Like wavelets, these "X-lets" allow us to separate a signal into different "scales" (analog to frequency in 1D, that is, how fast the signal is varying), "location" (equivalent to time in 1D) and the direction in which the signal is varying (which does not have 1D analog).
What separates curvelets from the other X-lets are their interesting properties, including:
- The curvelet transform has an exact inverse
- The discrete curvelet transform has efficient decomposition ("analysis") and reconstruction ("synthesis") implementations [1, 2]
- The curvelet transform is naturally N-dimensional
- Curvelet basis functions yield an optimally sparse representation of wave phenomena (seismic data, ultrasound data, etc.) [3]
- Curvelets have little redundancy, forming a tight frame [4]
You can find a good overview (plug: I wrote it!) of curvelets in the Medium article Demystifying Curvelets.
2. Why should I care about curvelets?
Curvelets have a long history and rich history in signal processing. They have been used for a multitude of tasks related in areas such as biomedical imaging (ultrasound, MRI), seismic imaging, synthetic aperture radar, among others. They allow us to extract useful features which can be used to attack problems such as segmentation, inpaining, classification, adaptive subtraction, etc.
3. Why do we need another curvelet transform library?
There are three flavors of the discrete curvelet transform with available implementations. The first two are based on the Fast Discrete Curvelet Transform (FDCT) pioneered by Candès, Demanet, Donoho and Ying. They are the "wrapping" and "USFFT" (unequally-spaced Fast Fourier Transform) versions of the FDCT. Both are implemented (2D and 3D for the wrapping version and 2D only for the USFFT version) in the proprietary CurveLab Toolbox in Matlab and C++.
As of 2024, any non-academic use of the CurveLab Toolbox requires a commercial license. This includes libraries which wrap the CurveLab toolbox such as pybind11-based wrapper curvelops, Python SWIG-based wrapper PyCurvelab. Neither curvelops nor PyCurvelab package include any source code of Curvelab. It should be noted, however, that any library which ports or converts Curvelab code to another language is subject to Curvelab's license. Again, neither curvelops or PyCurvelab do so, and can therefore be freely distributed as per their licenses (both have MIT licenses).
A third flavor is the Uniform Discrete Curvelet Transform (UDCT) which does not have the same restrictive license as the FDCT. The UDCT was first implemented in Matlab (see ucurvmd [dead link]) by one of its authors, Truong Nguyen. The 2D version was ported to Julia as the Curvelet.jl package, whose development has since been abandoned.
This library provides the first pure-Python implementation of the UDCT, borrowing heavily from Nguyen's original implementation. The goal of this library is to allow industry processionals to use the UDCT more easily.
Note: The Candès FDCTs and Nguyen UDCT are not the only curvelet transforms. To my knowledge, there is another implementation of the 3D Discrete Curvelet Transform named the LR-FCT (Low-Redudancy Fast Curvelet Transform) by Woiselle, Stack and Fadili [5], but the code seems to have disappeared off the internet [6]. Moreover, there is also another type of continuous curvelet transform, the monogenic curvelet transform [7], but I have found no implementation available. Lastly, the S2LET package the equivalent of curvelets but on the sphere [8].
4. Can I use curvelets for deep-learning?
This is another facet of the "data-centric" vs "model-centric" debate in machine learning. Exploiting curvelets is a type of model engineering, as opposed to using conventional model architectures and letting the data guide the learning process. Alternatively, if the transform is used as a preprocessing step, it can be seen from as feature engineering.
My suggestion is to use curvelets and other transforms for small to mid-sized datasets, especially in niche areas without a wide variety of high-quality tranining data. It has been shown that fixed filter banks can be useful in speeding up training and improving performance of deep neural networks [9, 10] in some cases.
Another expected to consider is the availability of high-performance, GPU-accelerated and autodiff-friendly libraries. As far as I know, no curvelet library (including this one) satisfies those constraints. Alternative transforms can be found in Kymatio and Pytorch Wavelets which implement the wavelet scattering transform [11] and dual-tree complex wavelet transform, respectively [12].
References
[1] Candès, E., L. Demanet, D. Donoho, and L. Ying, 2006, Fast Discrete Curvelet Transforms: Multiscale Modeling & Simulation, 5, 861–899.
[2] Nguyen, T. T., and H. Chauris, 2010, Uniform Discrete Curvelet Transform: IEEE Transactions on Signal Processing, 58, 3618–3634.
[3] Candès, E. J., and L. Demanet, 2005, The curvelet representation of wave propagators is optimally sparse: Communications on Pure and Applied Mathematics, 58, 1472–1528.
[4] Candès, E. J., and D. L. Donoho, 2003, New tight frames of curvelets and optimal representations of objects with piecewise C2 singularities: Communications on Pure and Applied Mathematics, 57, 219–266.
[5] Woiselle, A., J.-L. Starck, and J. Fadili, 2010, 3D curvelet transforms and astronomical data restoration: Applied and Computational Harmonic Analysis, 28, 171–188.
[6] Starck, Jean-Luc. F-CUR3D – CosmoStat: CosmoStat, 26 June 2017, www.cosmostat.org/software/f-cur3d. Accessed 25 Feb. 2024.
[7] Storath, M., 2010, The monogenic curvelet transform: 2010 IEEE International Conference on Image Processing.
[8] Chan, J. Y. H., B. Leistedt, T. D. Kitching, and J. D. McEwen, 2017, Second-Generation Curvelets on the Sphere: IEEE Transactions on Signal Processing, 65, 5–14.
[9] Luan, S., C. Chen, B. Zhang, J. Han, and J. Liu, 2018, Gabor Convolutional Networks: IEEE Transactions on Image Processing, 27, 4357–4366.
[10] Bruna, J., and S. Mallat, 2013, Invariant Scattering Convolution Networks: IEEE Transactions on Pattern Analysis and Machine Intelligence, 35, 1872–1886.
[11] Andreux, M., T. Angles, G. Exarchakis, R. Leonarduzzi, G. Rochette, L. Thiry, J. Zarka, S. Mallat, J. Andén, E. Belilovsky, J. Bruna, V. Lostanlen, M. Chaudhary, M. J. Hirn, E. Oyallon, S. Zhang, C. Cella, and M. Eickenberg, 2020, Kymatio: Scattering Transforms in Python: Journal of Machine Learning Research, 21(60), 1−6.
[12] Kingsbury, N., 2001, Complex Wavelets for Shift Invariant Analysis and Filtering of Signals: Applied and Computational Harmonic Analysis, 10, 234–253.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curvelets-0.1.0b2.tar.gz.
File metadata
- Download URL: curvelets-0.1.0b2.tar.gz
- Upload date:
- Size: 157.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de98d51e99ddeb082d3710f6a041b1070b873963297cd570eae4fc56eb3e7760
|
|
| MD5 |
8fd1074fd6a094842ef9f8118bd74a01
|
|
| BLAKE2b-256 |
10881d40a7f2175058f532fbdc9994da4b8ff58ff99ab1ef95c03e208a48d43a
|
Provenance
The following attestation bundles were made for curvelets-0.1.0b2.tar.gz:
Publisher:
cd.yml on cako/curvelets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curvelets-0.1.0b2.tar.gz -
Subject digest:
de98d51e99ddeb082d3710f6a041b1070b873963297cd570eae4fc56eb3e7760 - Sigstore transparency entry: 780063740
- Sigstore integration time:
-
Permalink:
cako/curvelets@3a143674f56e25ad394961ac7f638ae054cfbb53 -
Branch / Tag:
refs/tags/v0.1.0b2 - Owner: https://github.com/cako
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@3a143674f56e25ad394961ac7f638ae054cfbb53 -
Trigger Event:
release
-
Statement type:
File details
Details for the file curvelets-0.1.0b2-py3-none-any.whl.
File metadata
- Download URL: curvelets-0.1.0b2-py3-none-any.whl
- Upload date:
- Size: 56.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d475baf116552378bddd18a3695012637850818cb5115b03fbc034d0987591fd
|
|
| MD5 |
009d917328efa33984803c78117769bf
|
|
| BLAKE2b-256 |
a236dd1fe60483a82deb03a50e3947dfa80f1dfe03181c0c1424154980a1c27f
|
Provenance
The following attestation bundles were made for curvelets-0.1.0b2-py3-none-any.whl:
Publisher:
cd.yml on cako/curvelets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
curvelets-0.1.0b2-py3-none-any.whl -
Subject digest:
d475baf116552378bddd18a3695012637850818cb5115b03fbc034d0987591fd - Sigstore transparency entry: 780063741
- Sigstore integration time:
-
Permalink:
cako/curvelets@3a143674f56e25ad394961ac7f638ae054cfbb53 -
Branch / Tag:
refs/tags/v0.1.0b2 - Owner: https://github.com/cako
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@3a143674f56e25ad394961ac7f638ae054cfbb53 -
Trigger Event:
release
-
Statement type: