Gravitational Lens Confirmation Requ


I am a 9th grade high school student from the California Bay Area. I just completed a science fair research project where I trained a Vision Transformer machine learning model to identify images of gravitational lenses. I trained the model partly on real images of lenses and galaxies from the DES.

I applied the model on around 60,000 images of very red galaxies from the Sloan Digital Sky Survey, and received 544 Lens predictions, of which I have selected 21 that seem most likely to be lenses. To my knowledge, these coordinates have not been classified as lenses before.
I was wondering if anyone could review the potential lens images and confirm which ones are viable candidates.

Link to a Google Drive folder containing all the images: Gauri_Potential_Lenses - Google Drive
Grayscale versions of the images are in a subfolder, and coordinates are in the title of the images.
I would appreciate any other feedback or advice anyone may have as well.

Thank you!

  • Gauri Todur

Welcome and wow! That sounds very interesting! I will have a look at this folder and some databases and get back to you. Nice work!

@Ed-In-The-Couds think this might interest you :slight_smile:


So, I have had a look at them. One of them is a lens (known already sadly) but I don’t think the others are. Very nice strong lens it is though, congrats on finding it with an ML model - it isn’t easy. Full evaluation here. Interesting choice with the ViT - I am not very knowledgeable in this area but I thought they only tended to be better with >1m images of training or so (please correct me if I am wrong).

Best of luck with the fair and feel free to post any questions you have!



Thank you so much for the review!
I was wondering, how do you confirm which ones are lenses? Is there anything in particular that you look for in the image, or there additional data to access
Row 5, 6 and 7 seemed to me to be very likely lenses. Is there a reason those might not be lenses?

Thank you again!
Gauri Todur

Yes, ViTs do work better trained on millions of images. The ViT i used was already pretrained on 14m+ ImageNet images of random objects. I fine tuned the pretrained architechture on Lenses and Nonlenses, about under 40k images total.
I trained the model on data from DES, Hyper Suprime Cam, and SDSS, as well as simulated data generated via deeplenstronomy.

1 Like

Hi Gauri,welcome

Very impressive project so far as I can tell from your first post.

For lenses you can check in the SIMBAD database for individual object , also directly accessible from the viewer when you click on an object; a small menu appears including the SIMBAD link. Be sure to have the correct object because it will divert to the nearest object in the SIMBAD database.

Even better is to check your object coordinates in the VizieR catalog database, a lot of lenses are already found using similar methods as yours and published in catalogs, often as ‘candidates’. On the starting page for searching use the second input rectangle from above to input your coordinates.

The last days I’ve been forming the idea to grt into basic ML, would you have some pointers for starting, or expand on your project? ; which software did you use, how did you train it, how did you obtain the large image dataset from decals etc.

Would be very interesting!

Good luck on the fair,

  • Alexander

Ah very interesting, thank you. You learn something every day!

Also, after checking for known lens (candidates), you can post the remainder in a Galaxy Zoo post in Talk and / or in Talk of the Zooniverse Hubble Asteroid project (they discovered and published serendipitous lens find in HST images), for possible follow-up / recognition.

PS in VizieR you can use a search radius of 10-20 arcsecs, that should do the trick

Of course! Here

1 Like

VizieR takes a couple of lifetimes to understand though :slight_smile:.

Just quickly, do you agree with the conclusions I put in the doc below?


Hello Mr. Alexander,

Thank you for the resources; I have used VizieR before for accessing known lenses, and I will use it to confirm the potential candidates I have. I would be happy to help you on starting ML for astronomy; I’ve been coding for the past few years and I’m also very interested in applications of ML!
To start, I accessed tutorials for training and testing a ViT via GitHub. I started by downloading their sample code and data and ran training on a Nvidia Titan GPU (from 2013) that I had at home. GitHub repositories can be downloaded, and I used Jupyter Notebook to edit the Python code.
For the Lens class training set, I obtained DES lens coordinates from VizieR and put them in a CSV. I programmed a function to keep iterating through the CSV and insert the coordinates into DES image cutout URL’s to download images at each coordinate. Those were FITS though, which could not be run through the ViT so I converted them to TIFF file formats.
Most importantly, I recommend using more training data; I believe many current ML models train on supercomputer GPU clusters, which I don’t have access to. (With the ViT I still attained high F1 accuracies on real DES data, though.)

I am also looking into further expanding the project, and seeking some sort of mentor that can provide feedback and possibly guide me further.

Thank you again,
Gauri Todur


Nah, VizieR is quite simple really as I use it, just a coordinate check in all catalogs, nothing more.

Yes I agree completely! Im no expert but lenses usually come in (thin) arcs / circles, where in the case of a single arc there is usually a dot on the other side of the lensing galaxy (counter-image), or Eistein cross showung up as multiple dots (4?) around a lensing galaxy

1 Like

Use the second window to put in coordinates, change Target dimension (search radius) to something like 10 or 20 arcsecs and press Go!

Now wait until it is completed and you have all the catalogs that includes this particular object.

For lenses you just have to search for lens catalogs, usually at the bottom of the results, IIRC SuGiHo is the name of 1 lens catalog??

1 Like

Ah I see - thank you. Did this on the old Cheshire Cat - makes more sense. Weirdly IIRC SuGiHo hasn’t got anything on perhaps the most famous lensed image in the world :slight_smile:

1 Like

Thank you for the onfo provided so far, I think I should really start at the bottom and learn to code

A few years ago I’ve built a clunky Frankenstein machine using an Excel VBA script to download SDSS RGB images from the Legacy viewer and then feed them into a custom recorded program in Photoshop to spot handpicked RGB pixels in the images. So I have an inkling of the time and effort and problems arising with such a project

Which reminds me, the core reason why I would want to use this is finding Voorwerp candidates (among other interesting objects). But…. since you already have all the expertise perhaps you are up for another challenge with ML; finding Voorwerpjes (candidates)

It started with Hanny’s Voorwerp, then 19 others were found by Galaxy Zoo. Much later Bill Keel published 7 more in two papers with his own search projects.

The current thread where Voorwerp candidates are posted is actively monitored by Professor Emeritus Bill Keel & continous follow-up of good candidates.

Most of the posted candidates’ coordinates can be found in this thread:

I understand 27 confirmed Voorwerpjes is not a good training set, but with over 1500 candidates added you might get pretty far.

At this moment it is known that at least 38 new Voorwerpjes have been confirmed (unpublished)

Also Legacy DR10 is s real treasure trove because it openened up the Southern Hemisphere!

Sadly mentoring I cannot, Im just a citizen scientist with no coding / ML skills nor an expert on gravitational lenses

Thank you so far,


1 Like

First line made me laugh out loud. I am very much the same. My knowledge of coding is basic yet I invariably find myself contemplating how I could do something complicated.

1 Like

I have reached out to someone I know who works in ML aided identification and analysis of gravitational lensing (although mostly microlensing to look for planets) for any advice/forums/people to contact. For mentors however, just email a whole bunch of academics in the field. If you have already done as much as you have I am sure a few will happily reply and help.

Sincerely - someone who got into an intern-research assistant post by sending tons of emails (and barely getting any replies) to people who worked in the area I was interested in


I’ve danced around it for a long time, at the end of the great Voorwerp search I decided to go for it and try some SQL searches :joy: finally succeeded when I used the noobish IRSA GATOR module : D

1 Like

Sorry, its SuGOHI

1 Like

Ah thanks