# Predicting planets from orbital perturbations using deep learning

*A guest post by Kyle A. Pearson*

**Introduction**

In the early 1700s, physicists and astronomers were eagerly testing the newly-discovered laws of gravitation by Isaac Newton and planetary motion by Johannes Kepler. The astronomers Urbain Le Verrier and John Couch Adams conducted multiple observations of Uranus in the 1700s to test the theories. They independently concluded that Uranus’ orbit was deviating from their calculations based on Kepler’s laws. Uranus was accelerating and then slowing down at particular points in its orbit even when it was far away from the gravitational potential of Jupiter and Saturn. These two astronomers proposed that the perturbation Uranus experienced was due to another body in our Solar System. That body turned out to be Neptune, which was previously unknown before this prediction. The same technique of detecting orbital perturbations can be applied to exoplanets in order to discover new planets (see the figure below). However, matching data with a perturbation model requires testing thousands of N-body simulations in order to find the best-fit parameters for the perturber. Instead of using this brute force method, machine learning allows for a more efficient estimate of where to search in parameter space. Then, a more extensive analysis (e.g. using nested sampling) can be used to derive posterior distributions from which the final uncertainties and parameters are derived.

This project is a winning submission to the #PoweredByTF 2.0 Challenge. A more detailed technical description of how TensorFlow is used for this project can be found in this publication. The sections below give a physical description of the training data and summarize how TensorFlow is used.

**Measuring Perturbations**

Ground- and space-based telescopes are searching for planets around stars in order to find habitable and otherwise alien worlds. One way to measure the orbit of an exoplanet is to observe the brightness of a star over time and hope that a planet passes in front of the star, thus blocking out light proportional to the size of the planet. Periodic dips in the star’s brightness are assumed to come from orbiting planets, although other effects (e.g. star spots on a rotating star) can cause dips as well. Observational surveys (e.g., Kepler, TESS, WASP) target millions of stars in search of periodic signals that may indicate an orbiting planet. The Transiting Exoplanet Survey Satellite (TESS) is conducting an all sky survey in search of Earth-sized planets outside of our Solar System. Deep neural networks have done a remarkable job at sifting through these large data sets to find transit events (e.g., Pearson et al. 2018 and Shallue & Vanderburg 2018). After the events are found, a light curve model is optimized from the data in order to derive the “time of mid-transit”, the moment the planet is halfway through the transit. These mid-transit values are used to derive the orbital period by fitting a linear function to sequential mid-transit measurements. An orbital perturbation is measured from the difference between a linear fit and the data (typically called an observed minus calculated plot, O-C). Depending on the position of the perturbing body it can cause the inner planet to accelerate or slow down, changing its periodicity by typically a few minutes.

**Training Data**

While exoplanet discovery missions can measure perturbations down to a few minutes, interpreting the measurements is an iterative, computationally-intensive exercise. Computing a perturbation model for a multi-planet system requires integrating the equations of motion forward in time. In an N-body simulation, the acceleration of every body is computed using gravity which is then used to update the velocity and position at every timestep. Since the solution is not an analytic function, it requires sequential time integrations to derive acceleration changes since gravity depends on position (a figure detailing how certain parameters affect the shape of a perturbation can be found here). The project here uses the REBOUND framework for simulating the perturbations we expect to measure with a telescope. Discovering exoplanets is currently a prominent research topic with over 4000 confirmed planets but only a few hundred of those are multi-planet systems with an even smaller fraction of those yielding measurable perturbations. There are not enough real world measurements to train on so we must simulate examples based on what we predict to find. Generating an N-body simulation can be done using the source code below:

The code should produce an output like the figure below:

The N-body model depends on, at least, a few parameters: mass of the star (M*), mass of the inner planet (M1), period of the inner planet (P1), mass of the outer planet (M2), period of the outer planet (P2), eccentricity of the outer planet (e2), and argument of periastron for the outer planet (w2). Typically, parameters pertaining to the star and inner planet are known ahead of time. Therefore, a machine learning algorithm using TensorFlow is designed to predict the parameters of the perturbing body (M2, P2, e2, w2) given the known parameters and the measured perturbation (i.e., O-C data). The neural network is a dual-input, multi-output regression model. The independent features (M*, M1, P1) are analyzed using a fully connected neural network while the time-dependent features are analyzed using a convolutional neural network. The output of each branch is then piped into a fully-connected neural network and finally, 4 parameters** **(M2, P2, e2, w2) are predicted. An example of the neural network architecture is shown below.

Training data is simulated in order to optimize the neural network for working with data from a particular telescope survey (e.g., TESS). The TESS mission is conducting an all-sky survey and will measure portions of the sky for as many as 180 days but also as little as 27 days depending on the RA and Dec. Research suggests at least 20 transit measurements are needed to derive a unique orbit solution. If we encounter real data outside of the training range, then we can simulate more data and retrain. After training the neural network, the error and sensitivity are characterized as a function of orbital period and companion mass. These errors are used to estimate the priors for a more rigorous Bayesian optimization to derive posteriors for the planetary parameters (see Figure).

# Conclusion

Exoplanets in multi-planet systems experience gravitational perturbations from companions which can cause measurable differences in their orbits. These perturbations are used to assess the presence of an additional planet and their size. Analyzing the perturbations requires generating thousands of N-body simulations in order to find a set of parameters that best matches the data. An N-body model requires integrating the equations of motion in time and is computationally-expensive. Machine learning is used to map the correlations between orbital perturbations and the planetary system parameters. The uncertainties from a neural network prediction are used as priors in a Bayesian retrieval which assesses the significance of a model including an additional planet and one without. If you are interested in playing with the source code, please check out the Github page.

## References

- Analytic Light Curves for Planetary Transit Searches
- Mass and Orbit Determination from Transit Timing Variations of Exoplanets
- Searching for exoplanets using artificial intelligence
- Transiting Exoplanet Survey Satellite (TESS)
- Identifying Exoplanets with Deep Learning: A Five-planet Resonant Chain around Kepler-80 and an Eighth Planet around Kepler-90
- Evidence for 3 new multi-planet systems from TESS using a Bayesian N-body retrieval and machine learning