<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gaurang</title>
    <description>The latest articles on DEV Community by Gaurang (@debugastrobyte).</description>
    <link>https://dev.to/debugastrobyte</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3925784%2F1fa1d008-2c4b-44bf-9726-58bc7608c743.jpeg</url>
      <title>DEV Community: Gaurang</title>
      <link>https://dev.to/debugastrobyte</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/debugastrobyte"/>
    <language>en</language>
    <item>
      <title>I trained a neural network to find exoplanets. Here's what actually worked.</title>
      <dc:creator>Gaurang</dc:creator>
      <pubDate>Mon, 11 May 2026 20:04:07 +0000</pubDate>
      <link>https://dev.to/debugastrobyte/i-trained-a-neural-network-to-find-exoplanets-heres-what-actually-worked-3p56</link>
      <guid>https://dev.to/debugastrobyte/i-trained-a-neural-network-to-find-exoplanets-heres-what-actually-worked-3p56</guid>
      <description>&lt;p&gt;I have recently entered 12th grade, and I've been obsessed with exoplanets for a while now. Not in a casual way — I mean the kind of obsession where you start wondering if you could just... build something that finds them.&lt;/p&gt;

&lt;p&gt;So I did.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F971sb11w9b6o7875yoad.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F971sb11w9b6o7875yoad.gif" alt=" " width="720" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What even is an exoplanet classifier?&lt;/strong&gt;&lt;br&gt;
When a planet passes in front of a star, it blocks a tiny fraction of the star's light. Kepler spent 4 years staring at 150,000 stars looking for exactly that — those tiny dips. The result is thousands of light curves, each one a time series of a star's brightness over time.&lt;/p&gt;

&lt;p&gt;Some dips are planets. A lot aren't — instrument noise, binary stars, other stuff. NASA labels them as confirmed, false positive, or candidate.&lt;/p&gt;

&lt;p&gt;I wanted to see if a neural network could learn the difference.&lt;br&gt;
What I built&lt;/p&gt;

&lt;p&gt;A 1D CNN that takes a phase-folded light curve — 400 data points representing one orbit's worth of brightness — and outputs a probability: real planet or not.&lt;/p&gt;

&lt;p&gt;Ended up hitting 0.96 ROC-AUC on the test set, which honestly surprised me.&lt;br&gt;
The stuff that actually mattered&lt;br&gt;
Most tutorials would've had me just throw data at a model and call it done. A few things made a real difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I excluded CANDIDATE labels entirely. They're unverified — could be planets, could be noise. Training on them just teaches the model to be confidently wrong.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I was careful about the train/val/test split. Easy to accidentally let information from the test set leak into training. Took a while to get this right.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Class weights saved me. Confirmed planets are rare — about 1% of the dataset. Without telling the model this, it just learned to predict "not a planet" for everything and got 99% accuracy. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Technically correct, completely useless.&lt;/p&gt;

&lt;p&gt;The data pipeline runs 8 workers in parallel to fetch light curves from NASA's archive. This one was just satisfying to build.&lt;/p&gt;

&lt;p&gt;There's a live demo&lt;br&gt;
I made a Streamlit app where you can load the model and see it run on real test data — ROC curve, confusion matrix, the works. You can also see the actual light curves it's most confident about.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://exoplanet-classifier-agdeywxg3ngr22rxabzrqu.streamlit.app/" rel="noopener noreferrer"&gt;https://exoplanet-classifier-agdeywxg3ngr22rxabzrqu.streamlit.app/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code is here if you want to poke around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Debug-AstroByte/Exoplanet-Classifier" rel="noopener noreferrer"&gt;https://github.com/Debug-AstroByte/Exoplanet-Classifier&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I want to try next&lt;br&gt;
The precision on confirmed planets is still rough — there are only 5 confirmed planets in the test set vs 565 false positives, so even a good model looks bad on that metric. I want to try LSTMs, maybe attention, and eventually TESS data, which is more recent than Kepler.&lt;br&gt;
If you know this space and think I'm doing something dumb, genuinely tell me. I'd rather know.&lt;/p&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>astro</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
