A Python toolkit for CMB map model selection using Neural Networks
SkyNeuralNets is a modular Python package for model selection on CMB temperature and polarisation maps (T, Q, U) using Neural Networks. It provides a full ML pipeline from preprocessing and standardisation to training and evaluation, to classify CMB maps between standard ΛCDM and models with oscillatory features in the primordial power spectrum.
This package is designed to work with simulated data from SkySimulation and feeds into the interpretability analysis in SkyInterpret.
This code was developed as part of the analysis pipeline for Explaining Neural Networks on the Sky: Machine Learning Interpretability for CMB Maps.
- 🗂️ Preprocessing pipeline — Data preparation utilities for CMB map arrays, including cleaning and formatting for NN input
- 📐 Standardisation and Normalisation — Supports both z-score normalisation and per-map standardisation to ensure consistent input distributions across the dataset
- 🏗️ Hybrid PCA–MLP architecture — Implements a combined dimensionality reduction and classification network, compressing high-dimensional CMB maps before classification
- 🎯 Model selection — Binary (and multi-class) classification between ΛCDM and non-standard primordial feature models
- 🔧 Training utilities — Full training loop with configurable optimisers, loss functions, and early stopping fine-tuning
- 📊 Monitoring & evaluation — Track and evaluate model performance with metrics including AUC, validation loss, accuracy, and more
- Python ≥ 3.9
- numpy, scipy, matplotlib
- scikit-learn (for PCA)
- TensorFlow (specify which one you use)
All dependencies are listed in requirements.txt.
git clone https://github.com/skyexplain/SkyNeuralNets.git
cd SkyNeuralNets
pip install -e .See Sandbox for tutorials and examples.
This repository is part of a three-package ecosystem:
| Package | Description |
|---|---|
| SkySimulation | CMB map simulation (T, Q, U) with ΛCDM and oscillatory features |
| SkyNeuralNets | NN-based model selection on CMB maps (this repo) |
| SkyInterpret | Interpretability analysis of the trained neural networks |
If you use SkyNeuralNets in your research, please cite:
@article{ocampo2026explaining,
author = {Indira Ocampo and Guadalupe Cañas-Herrera},
title = {Explaining Neural Networks on the Sky: Machine Learning Interpretability for CMB Maps},
year = {2026},
eprint = {2604.05290},
archivePrefix = {arXiv}
}For questions or issues, please open a GitHub Issue or contact indira.ocampo@csic.es.