Gravitational Lens Detection with CNN & ResNet
Mar — Jun 2025
Gravitational lensing — the bending of light by massive bodies — is invaluable in astrophysics for probing dark matter and refining cosmological parameters. But detecting lensing events in survey data is hard: low signal-to-noise, varied morphologies, and image artifacts (PSF variability, cosmic rays, foreground stars) all confound classical pipelines.
This project benchmarks deep learning approaches end-to-end. Models are trained on simulated lens images and evaluated against real HST cutouts (CASTLES positives, COSMOS negatives) to test real-world generalization. Two tasks: binary classification, and Einstein-radius regression as a direct physical quantity prediction.
Key findings: deeper ResNet-18 models significantly outperform shallow CNNs on real test data, and training on realistic (PSF / noise / cosmic-ray augmented) simulations improves precision and recall substantially over idealized training. Grad-CAM saliency reveals that better-performing models attend to actual arc structures rather than background artifacts.
Highlights
- 01Two tasks: binary lens classification + Einstein-radius regression
- 02CNN vs ResNet-18 vs ViT comparison across idealized and photorealistic simulations
- 03Evaluated on real HST data (CASTLES + COSMOS) for generalization test
- 04Ablations: depth, augmentation, loss function, ImageNet pretraining vs random init
- 05Grad-CAM interpretability connecting attention to known lensing morphology
Report
Full writeup · PDF