This repository provides implementation of discrete wavelet transform (DWT) vis lifting scheme in TensorFlow (2.x). Operations can run on both: CPU and GPU, filter coefficients can be made trainable parameters of model. The following wavelets are implemented (15 in total):
- CDF-9/7 (used in lossy compression in JPEG 2000)
- CDF-5/3 (used in lossless compression in JPEG 2000)
- Haar
- Biorthogonal Spline Wavelets: 3/3, 3/5, 3/7, 3/9, 4/8
- Reverse Biorthogonal Spline Wavelets: 3/3, 3/5, 3/7, 3/9, 4/8
- Daubechies: 4
- Coiflets: 12
All the schemes have been tested for perfect reconstruction, i.e, operations of analysis and synthesis are invertible:
the error varies from approximately 1e-15 to 1e-14.
This repository also has a PyTorch port: https://github.com/uladzislau-varabei/torch-wavelet-lifting.
Below are some of the results with all the implemented wavelets. See file tests.py for details.
To get a better understanding of what lifting scheme for wavelets is, refer to the following image:
Application of DWT to 2d input (images) can be summarized with the following figure:
The same approach is applied to each image channel and to each image in batch. The implementation in this repository is vectorized, that is, at the same time all columns or rows of input are used, so it's very fast.
For clearer understanding of all the implemented wavelets it can be useful to see results on additional images.
Such results are presented in the results directory.
Original images for testing can be found in the images directory.
For details on lifting schemes for different wavelets a special thank is for Alex Malevich.



