Skip to content

XYangXRay/selfphish

SELFPHISH: Self-supervised, Physics-Informed Generative Networks for Phase Retrieval

PyPI License Python

Overview

SELFPHISH is a flexible data reconstruction framework that harnesses self-supervised, physics-informed generative networks. Unlike traditional methods that rely on complex algorithms, SELFPHISH leverages deep generative models guided by physical constraints to advance the phase retrieval process.

Originally designed for complex phase retrieval in tomography and holography, SELFPHISH is highly adaptable and can incorporate user-defined forward models for a wide range of advanced data reconstruction challenges.

Features

  • Self-supervised, Physics-Informed Networks: Deep generative networks that are both self-supervised and physics-guided for state-of-the-art reconstruction.
  • Specialized for Phase Retrieval: Optimized for phase retrieval and tomography tasks, ensuring precise and reliable reconstructions.
  • Modular Design: Easily integrate custom forward models for diverse reconstruction challenges.
  • Efficient and Scalable: Handles large datasets efficiently without compromising accuracy.

The flowchart of Selfphish

Installation

The following steps will help you set up the selfphish package in a Conda environment.

For General Users

  1. Create & Activate a Conda Environment

    conda create --name selfphish python=3.11
    conda activate selfphish
  2. Install SELFPHISH from PyPI

    • For the default TensorFlow backend:
      pip install selfphish
    • For the PyTorch backend:
      pip install "selfphish[pytorch]"

For Developers

If you are contributing to SELFPHISH development, follow these steps:

  1. Create & Activate a Conda Environment

    conda create --name selfphish python=3.11
    conda activate selfphish
  2. Clone the SELFPHISH Repository

    git clone https://github.com/XYangXRay/selfphish.git
    cd selfphish
  3. Install Required Packages in Editable Mode

    python3 -m pip install -e .

Additional Notes

  • Choosing a Backend:
    • TensorFlow is recommended for production and TFX integration.
    • PyTorch is popular for research and dynamic computation graphs.
  • GPU Support:
    • SELFPHISH is designed for GPU acceleration. Install the GPU versions of TensorFlow or PyTorch as needed. See their official documentation for details.

Examples

SELFPHISH includes ready-to-run examples for phase retrieval and tomography:

  1. Holography phase retrieval:
  2. X-ray tomography:

Citation

If you use SELFPHISH in your research or projects, please cite:

Xiaogang Yang, Dawit Hailu, Vojtěch Kulvait, Thomas Jentschke, Silja Flenner, Imke Greving, Stuart I. Campbell, Johannes Hagemann, Christian G. Schroer, Tak Ming Wong, and Julian Moosmann, "Self-supervised physics-informed generative networks for phase retrieval from a single X-ray hologram," Opt. Express 33, 35832-35851 (2025)
Available at: https://doi.org/10.1364/OE.569216

J. Synchrotron Rad. (2020). 27, 486-493.
Available at: https://doi.org/10.1107/S1600577520000831

About

Self-supervised physics-informed generative networks for phase retrieval from a single X-ray hologram

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages