Implement unsupervised autoencoder SR for simulated lensing images (DEEPLENSE2) #117
+1,568
−0
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