We’ve all had to do something tedious before. You love a class in school or a role at work, but inevitably, you find yourself performing a rote, repetitive task that makes you question how you’re spending your days.
For astronomers, particularly astronomy students, that task is counting craters. Here’s the thing: counting is absolutely essential. If you look up at the night sky and see a planet, moon, or asteroid, craters are one of the best indicators of its history and geology.
Here’s the short version: a planet like ours has very few visible craters because we have a thick atmosphere that keeps meteors from hitting the surface frequently, not to mention oceans and rain which erode and hide the craters that do occur. Mars has much less of an atmosphere, but does have sandstorms, has more craters. The Moon and Mercury — basically desolate rocks — have even more craters.
Astronomers can make astounding inferences with a simple count of craters, but understandably, they aren’t excited to spend all night counting.
Michael Klear, an astronomer-turned-data scientist, built their remedy. As a student in Thinkful’s Data Science program, Michael learned several machine learning techniques that proved useful for analyzing images to detect patterns.
He used those techniques to build PyCDA — Python Crater Detection Algorithm. It’s available as a package from PyPi; you can install it just by typing ‘pip install pycda’ into your Terminal.
What it Does and How It Works:
First, the algorithm makes a heatmap, classifying areas that look like they are part of a crater… or not. Take a look at the resulting images:
By identifying the distinct objects, making sure that it’s counting craters that are too small for the naked eye to see, and counting overlapping craters as multiple craters, the algorithm doesn’t just automate a task — it performs at a superhuman level.
Can you honestly say you would have circled all of these?
That’s the power of data science.
Looking for a bit more detail — for example, how the algorithm deals with overlapping craters? Michael told his story himself on the Thinkful Blog, you can find out what motivated his decisions, where he ran into issues, and see more detailed graphics explaining each stage of the building process.
This post was sponsored by Thinkful.