Discovering Exoplanets Using Neural Networks
By: Blenda Guedes
Tags: Neural Networks, Editors Pick, NASA, Kepler, Multilayer Perceptron

Discovering Exoplanets Using Neural Networks

Project made to complete the credits for the discipline of Neural Networks in the master’s program in Applied Computing. As I had to present an experiment and an article, the repository will have all the experimental code and this Medium story will present most of what is valuable to share with this community about my work.

“Artist concept. A crop of more than 100 planets, discovered by NASA’s Kepler Space Telescope, includes four in Earth’s size-range orbiting a single dwarf star. Two of these planets are too hot to support life as we know it, but two are in the star’s “habitable” zone, where liquid water could exist on the surface.” Credits: NASA/JPL

Kepler Space Observatory

In 2009 the Kepler Space Observatory was launched by NASA, with the aim to answer the question:

The observatory is on its second mission since 2014, and had labeled more than 10,000 possible exoplanets.

Kepler scanned 1,284 new exoplanets in 2016. As in 2017, there were more than 3,000 exoplanets confirmed in total (using all detection methods, including ground-based ones). The observatory still works and keep on searching for other exoplanets.

Our goal with this project is to use the data collected by the Kepler Space Observatory available on Kaggle and build a Neural Networks model solution that, given the characteristics collected by Kepler, is feasible to identify exoplanets. I won’t go deep on the data cleaning or the characteristics I am using, that is for a future story project.

What are Exoplanets?

Our star is the Sun, looking at the dark sky, that are other multiple stars on our galaxy. Each of those stars can or can’t have they our planets orbiting them so they have their own solar system. And those planets are exoplanets, we can also say that exoplanets are planets in other solar systems that are not ours.

“When a planet crosses in front of its star as viewed by an observer, the event is called a transit.” Credits: NASA Ames

Another important goal of this NASA mission is to find “other Earths”. The Kepler Mission overview says that one of its goals is “Determine the percentage of terrestrial and larger planets that are in or near the habitable zone of a wide variety of stars”. Those are planets that are half or twice the size of the Earth. Below you can find examples of planets that can be habitable.

“The sweep of NASA Kepler mission’s search for small, habitable planets in the last nine years. The first planet smaller than Earth, Kepler-20e, was discovered in December 2011 orbiting a Sun-like star slightly cooler and smaller than our sun every six days. But it is scorching hot and unable to maintain an atmosphere or a liquid water ocean. Kepler-22b was announced in the same month, as the first planet in the habitable zone of a sun-like star, but is more than twice the size of Earth and therefore unlikely to have a solid surface. Kepler-186f was discovered in April 2014 and is the first Earth-size planet found in the habitable zone of a small, cool M dwarf about half the size and mass of our sun. Kepler-452b is the first near-Earth-Size planet in the habitable zone of a star very similar to the sun.” Credit: NASA Ames/W. Stenzel

The Experiment…

The machine used was a MacBook Pro 2017, with a Mac OS Mojave operating system, 500Gb SSD, RAM 16Gb, processor of 2.9 GHz QuadCore Intel Core i7. The programming language used was Python 3.6 and the PyTorch library was used to built the Neural Networks.

Database

The database was taken by the Kaggle platform. And the data cleaning was based on the Ismael Araujo work. 7,803 samples were available with them 38 characteristics, one of them is ExoplanetCandidate that one will become the label. Finally I had 37 different characteristics to use as a input and a binary output.

Credits: Image by author.

Credits: Image by author.

The data was divided in three parts where 70% was to training, 15% to validation and 15% to testing. The features were normalized using min-max scaling, the validation and training were transformed to using the DataLoader from PyTorch. See the code bellow:

The Neural Networks

As I believe that the Medium community is very rich on the matter of explaining Machine Learning subjects, I am not going deep on define the theoretical part of the algorithms used in this experiment. Although this ayşe bilge gündüz post has a very good mathematical base if you don’t have a theoretical background.

I used three different neural network: a simpler Perceptron and two Multilayer Perceptrons, one with three hidden layers and the other with two. They also varied in activation function. In the end five Neural Networks were build, the table bellow was organized to a better understanding of each of them:

Credits: Image by author.

All the Neural Networks used had on their output layer a Sigmoid Function, a threshold of 0.5 was used to the final classification. The images bellow show the representation of the three different architectures:

Perceptron. Credits: Image by author.

Figure 3: MLP with 3 Hidden Layers Topology. Credits: Image by author.

Figure 2: MLP with 2 Hidden Layers Topology. Credits: Image by author.

Bellow you can also see the code of a Multilayer Perceptron with 2 hidden layers, build using PyTorch. You can notice that it has Sigmoid function on its last layer.

Training

The training was made using the Adam as optimizer, using 0.01 as the learning rate and using Mean Squared Error as loss function. Two different training were made, one with 100 epochs and another with 50 epochs. All the other configurations of the training remained the same. That way the total of 10 experiments were made.

The training loss graph for both experiments:

Figure 5: Training loss during Experiment B. Credits: Image by author.

Figure 4: Training loss during Experiment A. Credits: Image by author.

You can see that the training using 50 epochs is a short version of the training using 100, it is important to remember that the seed remains the same in all the trainings. The reason for try the 50 epochs was to understand if it was possible to the same results with less effort.

Results

Credits: Image by author.

Above you see the table with the results using different all 10 different networks configurations. Here we will call the experiment with 100 epochs Experiment A, and the experiment with 50 epochs Experiment B.

Final thoughts

As we could see that the results of the experiments had all very close values of performance, taking as conclusion that least complex Neural Network could bring us a very similar result to the ones with more layers. What makes us believe that a Perceptron would perform a good analysis algorithm to the problem we have.

All the data and code are available on github repository.