D-Flat
is an auto-differentiable design framework for flat optics, specially geared to the design of dielectric metasurfaces for imaging and sensing tasks. This package was first introduced in a 2022 manuscript available at arxiv. It was later published alongside our paper, Polarization Multi-Image Synthesis with Birefringent Metasurfaces, in the proceedings of the 2023 IEEE International Conference of Computational Photography (ICCP).
D-Flat provides users with:
By treating optical layers in the same fashion as standard, differentiable neural layers, deep learning pipelines can be built to simultaneously optimize optical hardware and ML computational back-ends for the next generation of computational imaging devices.
Dflat version 4 presents several changes relative to v3. Some scripts in the Fourier layer have been modified to improve the computational speed and efficiency. The package has also been restructured for easier interpretability; we have removed extra scripts, functions, and files that were related to the original papers and were only there for initial academic benchmarking. Lastly, all data files are now stored on dropbox and downloaded during install.
Older versions will now be kept as seperate branches for archival purposes.
Some of these changes might have introduced unexpected bugs or behaviors. Please report if you find something incorrect or errors in runtime.
A readthedocs page will be provided in the future. You may also visit the code pages for projects that use DFlat to learn more (example: https://github.com/DeanHazineh/Multi-Image-Synthesis). Several tutorial notebooks (google collabs linked below) are also provided as demos. Additional examples will be provided in the future and we welcome community made examples sent by email.
For developers and researchers,
DFlat/dflat/neural_optical_layer/core/trainer_models.py
DFlat/dflat/cell_library_generation/
.Note that DFlat can be easily installed and used in the cloud on Google Collab if desired. This is a potential solution for mac users who wish to use the code without access to a windows/linux compute cluster, as tensorflow_gpu is not supported by mac. Google collab versions of current examples can be found in the examples folder and online at the links:
Install the local repository to your venv by entering the following in terminal:
git clone https://github.com/DeanHazineh/DFlat-tensorflow.git
python setup.py develop
Note, for the paths to resolve to the data files that are downloaded from dropbox, we need to install with python setup.py develop instead of the usual “pip install .” command.
If there are unexpected issues with the pip install, try to install the package via: python setup.py install
. This was needed on google collab but not for local builds for some unknown reason.
If you utilize DFlat or included data sets for your own work, please cite it by copying:
@INPROCEEDINGS{10233735,
author={Hazineh, Dean and Lim, Soon Wei Daniel and Guo, Qi and Capasso, Federico and Zickler, Todd},
booktitle={2023 IEEE International Conference on Computational Photography (ICCP)},
title={Polarization Multi-Image Synthesis with Birefringent Metasurfaces},
year={2023},
pages={1-12},
doi={10.1109/ICCP56744.2023.10233735}}
This work pulls inspiration from, builds on, or otherwise ports/modifies previous open-source contributions from the following individuals:
This repository is intended to be accessible and community driven. It may not be fully error-proof. If you have improvements, fixes, or contributions, please branch and initiate a merge request to master (or email me)!
For any questions, functionality requests, or other concerns, don’t hesitate to contact me at dhazineh@g.harvard.edu.