DeepLens is a differentiable optical lens simulator. It is developed for (1) differentiable optical design, (2) end-to-end optics-vision co-design, and (3) photorealistic image simulation. DeepLens helps researchers build custom differentiable optical systems and computational imaging pipelines with minimal effort.
- Next-generation optical design software enhanced by differentiable optimization.
- Next-generation computational cameras integrating optical encoding with deep learning decoding.
- Differentiable Optics. DeepLens leverages gradient backpropagation and differentiable optimization, demonstrating outstanding optimization power compared to classical optical design.
- Automated Lens Design. Enables automated lens design using curriculum learning, optical regularization losses, and GPU acceleration.
- Hybrid Refractive-Diffractive Optics. Supports accurate simulation and optimization of hybrid refractive-diffractive lenses (e.g., DOEs, metasurfaces).
- Accurate Image Simulation. Delivers photorealistic, spatially-varying image simulations, verified against commercial software and real-world experiments.
- Optics-Vision Co-Design. Supports end-to-end differentiability from optics, sensor, and ISP to vision algorithms, enabling comprehensive optics-vision co-design.
Additional features (available via collaboration):
- Polarization Ray Tracing. Provides polarization ray tracing and differentiable optimization of coating films.
- Non-Sequential Ray Tracing. Includes a differentiable non-sequential ray tracing model for stray light analysis and optimization.
- Kernel Acceleration. Achieves >10x speedup and >90% GPU memory reduction with custom GPU kernels across NVIDIA and AMD platforms.
- Distributed Optimization. Supports distributed simulation and optimization for billions of rays and high-resolution (>100k x 100k) diffractive computations.
Fully automated lens design from scratch. Try it with AutoLens!
Lens-network co-design from scratch using final images (or classification/detection/segmentation) as objective.
A surrogate network for fast (aberration + defocus) image simulation.
Design hybrid refractive-diffractive lenses with a new ray-wave model.
Clone this repo:
git clone https://github.com/singer-yang/DeepLens
cd DeepLens
Create a conda environment:
conda env create -f environment.yml -n deeplens_env
or
conda create --name deeplens_env python=3.9
conda activate deeplens_env
pip install -r requirements.txt
Run the demo code:
python 0_hello_deeplens.py
DeepLens repo is structured as follows:
DeepLens/
│
├── deeplens/
│ ├── optics/ (optics simulation)
| ├── sensor/ (sensor simulation)
| ├── network/ (network architectures)
| ├── ...
| ├── geolens.py (refractive lens with ray tracing model)
| ├── diffraclens.py (diffractive lens with wave optics model)
| └── your_own_optical_system.py (your own optical lens)
│
├── 0_hello_deeplens.py (code tutorials)
├── ...
└── write_your_own_code.py
Join our Slack workspace and WeChat Group (singeryang1999) to connect with our core contributors, receive the latest industry updates, and be part of our community. For any inquiries, contact Xinge Yang (xinge.yang@kaust.edu.sa).
We welcome all contributions. To get started, please read our Contributing Guide or check out open questions. All project participants are expected to adhere to our Code of Conduct. A list of contributors can be viewed in Contributors and below:
DeepLens is released under the Creative Commons Attribution-NonCommercial 4.0 International License. This means the project can be used for non-commercial purposes with attribution.
If you use DeepLens in your research, please cite the paper. See more in History of DeepLens.
@article{yang2024curriculum,
title={Curriculum learning for ab initio deep learned refractive optics},
author={Yang, Xinge and Fu, Qiang and Heidrich, Wolfgang},
journal={Nature communications},
volume={15},
number={1},
pages={6572},
year={2024},
publisher={Nature Publishing Group UK London}
}