AstroAI Workshop 2026
Alberto Guirado
AstroDetector: Comparing CNN and Random Forest Classifiers for Gravitational Lens Detection in Astronomical Imagery
Presenter: Alberto Guirado
Title: AstroDetector: Comparing CNN and Random Forest Classifiers for Gravitational Lens Detection in Astronomical Imagery
Date/Time: Monday, June 15, 4:00 PM - 5:30 PM
VIRTUAL
Abstract: Gravitational lenses — predicted by Einstein’s general relativity — are among the rarest astrophysical phenomena observable from Earth, offering a direct probe of dark matter distribution and cosmological structure. Their automated detection from telescope surveys remains an open challenge due to morphological ambiguity with other compact objects and extreme class imbalance in available datasets.
This work presents AstroDetector, a multi-class image classifier trained on 8,118 images sourced via automated web scraping from astronomical archives including Hubble and James Webb Space Telescope data. The dataset covers four classes — galaxies, nebulae, gravitational lenses, and globular clusters — and was class-balanced to 963 samples prior to training. Two architectures were benchmarked on a stratified 70/30 split: a 5-layer Convolutional Neural Network (CNN, 510K parameters, Adam, 80 epochs, ~19 seconds training) and a Random Forest Classifier (RFC, 20 trees, entropy criterion, ~1.8 minutes training).
For gravitational lens detection specifically, the RFC outperformed the CNN in recall (84% vs. 58%), despite comparable overall accuracy (83% vs. 82%). The CNN showed significant confusion between lenses and nebulae (27% misclassification rate), suggesting that flat feature representations may better capture the ring-like morphology of lenses than shallow convolutional hierarchies at this scale. These results motivate the exploration of deeper architectures, simulation-based inference, and augmented lens catalogues to advance automated lens discovery at survey scale.