Implement unsupervised autoencoder SR for simulated lensing images (DEEPLENSE2)#117
Open
nikhilchhokar wants to merge 2 commits intoML4SCI:mainfrom
Open
Implement unsupervised autoencoder SR for simulated lensing images (DEEPLENSE2)#117nikhilchhokar wants to merge 2 commits intoML4SCI:mainfrom
nikhilchhokar wants to merge 2 commits intoML4SCI:mainfrom
Conversation
added 2 commits
January 23, 2026 06:18
- Add SuperResolutionAutoencoder (U-Net architecture) - Implement perceptual loss (reconstruction + gradient) - Add PSNR and SSIM evaluation metrics - Support real DeepLense Model I/II/III data loading - Include comprehensive training script with CLI args - Add full documentation Addresses DEEPLENSE2 Task ML4SCI#1: unsupervised SR on simulated images. Builds on PR ML4SCI#109 (baseline infrastructure). Tested on Windows 11, PyTorch 2.10, Python 3.13.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
This PR implements DEEPLENSE2 Task #1: "Start with unsupervised SR of simulated images and think of ways to bridge the gap to real images."
Builds on PR #109 (baseline infrastructure) by adding:
This directly addresses the proposal's core requirements:
What Changed
New Files Added:
autoencoder_sr.py(~300 lines)SuperResolutionAutoencoder: U-Net style encoder-decoderPerceptualLoss: Combined reconstruction + gradient lossapply_degradation(): Unsupervised training helpertrain_autoencoder_sr.py(~450 lines)README_autoencoder_SR.md(~200 lines)File Structure:
Key Features
1. Unsupervised Learning ✅
Unlike PR #1 (supervised SRCNN), this does not require paired LR/HR images:
Why this matters for DEEPLENSE2:
2. Autoencoder Architecture ✅
Implements proposal requirement: "familiarity with autoencoders"
Architecture:
Skip connections (U-Net style):
3. Real Dataset Support ✅
Addresses proposal: "lensing images created with real galaxy datasets"
Supported formats:
.npyfile.npyfiles(N, H, W),(N, 1, H, W),(N, C, H, W)4. Evaluation Metrics ✅
Quantitative assessment missing from PR #1:
PSNR (Peak Signal-to-Noise Ratio):
SSIM (Structural Similarity Index):
Example output:
5. Perceptual Loss ✅
Combines two loss components:
Result: Sharper, more realistic images than MSE-only training
What This Enables
For DEEPLENSE2 Proposal:
For Research:
For Future PRs:
What's NOT Done (Intentional)
This PR focuses on DEEPLENSE2 Task #1, deliberately excluding:
These are planned for follow-up PRs to maintain focused, reviewable changes.
Testing
Test 1: Synthetic Data (No Dependencies)
Expected:
outputs_pr2/Test 2: Real DeepLense Data (If Available)
Test 3: Different Configurations
Verified on:
Results
Training on Synthetic Data (20 epochs):
Both PRs are complementary:
Next Steps
Immediate (within this PR):
Future PRs (DEEPLENSE2 completion):
Sim-to-real gap analysis (Task Push DeepLeense Regression Code #1 continuation)
Lens analysis integration (Task Initial commit for DeepLense Regression #2)
Advanced architectures
References