A complete course on edge-preserving anisotropic image filtering. The course takes you from the elementary heat equation all the way to a publishable-quality filter library grounded in Finsler geometry, following
H. Kilic, S. Ceyhan & O. N. Gerek, "A novel family of edge preserving anisotropic filters", Digital Signal Processing 128 (2022) 103623. https://doi.org/10.1016/j.dsp.2022.103623
Classical filters (Gaussian, mean, median) remove noise but blur edges. Anisotropic, geometry-driven filters remove noise while preserving edges, which is critical when filtering is a pre-processing step before edge detection, segmentation, or measurement — for example in biomedical or satellite imaging. This course explains why these filters work, derives them from first principles, and has you build your own.
| Week | Notebook | Topic | Role of diffusion |
|---|---|---|---|
| 1 | 01_foundations.ipynb |
Foundations | Anatomy of diffusion, heat equation, FDM, Perona–Malik, vectorisation |
| 2 | 02_variational_theory.ipynb |
Variational approach | Energy functionals (Dirichlet energy) and minimisation |
| 3 | 03_polyakov_action.ipynb |
Polyakov action | Deriving the energy integral; modelling the image surface |
| 4 | 04_laplace_beltrami.ipynb |
Laplace–Beltrami flow | Diffusion as a geometric operator |
| 5 | 05_finsler_geometry.ipynb |
Finsler geometry | From Riemann to Finsler; defining metrics |
| 6 | 06_new_randers.ipynb |
Randers metrics | The New Randers metric in the flow |
| 7 | 07_miron_normalized.ipynb |
Miron metrics | New Normalized Miron and edge analysis |
| 8 | 08_numerical_schemes.ipynb |
Advanced PDE solving | Stability (CFL), boundary conditions, implicit solvers |
| 9 | 09_cuda_acceleration.ipynb |
GPU & parallelisation | Numba/CUDA hardware acceleration |
| 10 | 10_multichannel_flow.ipynb |
Colour (RGB) flow | Vector diffusion, colour-space coupling |
| 11 | 11_benchmarking.ipynb |
Quality & validation | PSNR, SSIM, IF, MI and the Edge-Preservation Index (EPI) |
| 12 | 12_final_thesis.ipynb |
Capstone project | Build your own Custom Anisotropic Filter library |
A printable syllabus with weekly objectives and the English language-focus map is in
SYLLABUS.md.
All notebooks import a small, tested reference library that implements the paper's algorithms:
import anisofilt as af
from anisofilt import utils, metrics
img = utils.sample_image("camera", size=256)
noisy = utils.add_gaussian_noise(img, sigma=0.08)
# Paper's best-performing filters (beta=1, dt=0.05, 20 iterations):
denoised = af.new_metric(noisy) # New Metric (Synge-Beil, c = 1 - 1/g)
denoised = af.new_normalized_miron(noisy) # New Normalized Miron, c = (1 - 1/g)/V
denoised = af.new_randers(noisy) # New Randers metric
print("PSNR:", metrics.psnr(img, denoised))
print("EPI :", metrics.edge_preservation_index(img, denoised))| Module | Contents |
|---|---|
anisofilt.core |
finite-difference derivatives, metric tensor g_{μν}, determinant, inverse, isotropic Laplace–Beltrami |
anisofilt.tangents |
3×3 maximum-contrast tangent-vector estimation |
anisofilt.finsler |
Synge–Beil family: Normalized Miron, New Normalized Miron, New Metric |
anisofilt.randers |
New Randers metric filter |
anisofilt.classical |
isotropic Beltrami flow + Gaussian / mean / median / Perona–Malik baselines |
anisofilt.metrics |
MSE, PSNR, IF, SSIM, MI, Edge-Preservation Index |
anisofilt.utils |
test images, noise models, synthetic edge scenes |
git clone https://github.com/HAYDARKILIC/adv_pde_based_image_processing.git
cd adv_pde_based_image_processing
python -m venv .venv && source .venv/bin/activate # optional
pip install -r requirements.txt
pip install -e . # installs the `anisofilt` package in editable mode
jupyter lab # open the notebooks/ folderGPU note. Week 9 auto-detects your hardware. The Numba CPU path runs everywhere; the CUDA path executes only if an NVIDIA GPU is present and otherwise prints the kernel for study — no error either way.
pip install pytest
pytest -qThe test suite checks that every filter improves PSNR on a noisy image and that the quality metrics behave correctly (e.g. PSNR of an image against itself is infinite).
- Read the markdown of a week top-to-bottom before running the code.
- Run each code cell and tie its output back to the equation it implements.
- Do the end-of-notebook Exercises — they include a writing task each week.
- By Week 12 you assemble everything into your own filter and write a short report.
Course code released under the MIT License (see LICENSE).
If you use this material, please cite the original paper:
@article{kilic2022anisotropic,
title = {A novel family of edge preserving anisotropic filters},
author = {Kilic, Haydar and Ceyhan, Salim and Gerek, Omer Nezih},
journal = {Digital Signal Processing},
volume = {128},
pages = {103623},
year = {2022},
doi = {10.1016/j.dsp.2022.103623}
}