This repository contains Python code for simulating spectral radiances from asteroid surfaces, and for training a convolutional neural network to predict surface temperatures from said radiances. The temperature predictions are used to correct spectral radiance observations for thermal contribution, in order to accurately determine the spectral reflectance. The software is published under the MIT license. This repository is related to a journal article titled "Deep learning-based asteroid surface temperature evaluation from disk-resolved near-infrared spectra for thermal excess correction", published in the journal Planetary and Space Science in 2023. The article is freely available through this link: https://doi.org/10.1016/j.pss.2023.105738
The workings of the code could be roughly divided into three parts: data generation, training a network, and testing the trained network. In broader terms the idea is to feed a spectral radiance observed from an asteroid's surface to a neural network and receive a temperature prediction for the observed area as output. This can then be used together with an emissivity value to get a prediction for thermally emitted spectral radiance. Subtracting the thermal spectrum from the original sum spectrum yields an approximation for reflected radiance.
The training data consists of spectral radiances in the wavelengths 0.45 - 2.45 µm, and ground truth temperature values corresponding to the spectra radiances. The radiances are generated with a very rudimentary simulator, which models total spectral radiance as a sum of reflected and thermally emitted radiances. Thermal radiance is produced with Planck's law, plugging in a temperature value and multiplying the final result by an emissivity. Reflected radiances are modeled with the Lommel-Seeliger law, which requires incident spectral irradiance, spectral single-scattering albedo, and incidence and emission angles. Single-scattering albedos are produced from normalized reflectance spectra of asteroids produced in this study by Penttilä et al.: https://doi.org/10.1051/0004-6361/202038545. For training purposes the sum spectral radiances are the training samples, and the temperatures used to produce the thermal radiances are the ground truth.
The neural network input is a spectral radiance with 200 channels from wavelength range 0.45 - 2.45 µm. The output is a temperature value in kelvin. These determine the input layer to be 200 units wide, and the output 1 unit. The architecture of the hidden layers is based on a convolutional neural network (CNN), with a number of 1D convolution layers followed by dense layers. The architecture was optimized with KerasTuner, and methods for this are also included.
Testing the network was done with synthetic data also used for validation during training, and with real OVIRS observations of Bennu. The latter were produced in this article: https://doi.org/10.1126/science.abc3522, and were graciously provided to us by the author, Dr. Amy A. Simon. Temperature predictions by the network were compared to ground truth data, and radiances and reflectances corrected using the predictions to ones corrected with the ground truth values. Results of a test run are presented mostly through various plots.
The code is written entirely in Python, using Conda for managing packages.
The tool used for creating the neural network was TensorFlow with its Keras
framework.
The various packages and modules and their
versions used in this project are listed in the file
environment.yml
, which can be used to generate a
matching Conda environment.
N.B. For running the neural network code
on a GPU, you will need a different version of Tensorflow than the one listed
in environment.yml
. The listed version only supports CPU execution.
The code is divided into several files, the contents of which are broadly as follows:
constants.py
- all constants (or at least most of them), including physical constants, parameters for data generation and neural network architecture, and paths. The paths lay out a folder structure which users may re-create on their own machine.file_handling.py
- methods for reading files from disc or writing into filesmain.py
- main method for running the program, includes some example calls to the various methodsneural_network.py
- building a neural network, training it, and optimizing the architectureradiance_data.py
- producing a radiance dataset for training, by simulating reflected and thermally emitted spectral radiancesreflectance_data.py
- methods for working with asteroid reflectance datautils.py
- utility methods which did not fit into other modulesvalidation.py
- testing the performance of a trained neural network
The training
-folder has in its subfolder the final weights of the trained
neural network, stored in a format compatible with Keras. The folder also
contains a log of the loss history for the final training run.
We have published an article related to this work in the journal Planetary and Space Science, and you can find it here: https://doi.org/10.1016/j.pss.2023.105738
If you use the code found in this repository for your own research, please cite the article for example using this bibtex entry:
@article{Lind2023,
title = {Deep learning-based asteroid surface temperature evaluation from disk-resolved near-infrared spectra for thermal excess correction},
journal = {Planetary and Space Science},
volume = {235},
pages = {105738},
year = {2023},
issn = {0032-0633},
doi = {https://doi.org/10.1016/j.pss.2023.105738},
url = {https://www.sciencedirect.com/science/article/pii/S0032063323001071},
author = {Leevi Lind and Antti Penttilä and Kimmo A. Riihiaho and Eric MacLennan and Ilkka Pölönen},
keywords = {Asteroid, Near-infrared, Disk-resolved, Reflectance spectroscopy, Thermal excess, Neural network},
}