btsbot

Automated identification of supernovae with multi-modal deep learning

https://github.com/nabeelre/btsbot

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, iop.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.9%) to scientific vocabulary

Keywords

astronomy astrophysics computer-vision time-domain-astronomy transient-astronomy ztf
Last synced: 6 months ago · JSON representation ·

Repository

Automated identification of supernovae with multi-modal deep learning

Basic Info
Statistics
  • Stars: 15
  • Watchers: 3
  • Forks: 3
  • Open Issues: 0
  • Releases: 1
Topics
astronomy astrophysics computer-vision time-domain-astronomy transient-astronomy ztf
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation Support

README.md

BTSbot Logo

arXiv arXiv ascl:2403.004

BTSbot is a multi-modal convolutional neural network for automating supernova identification and follow-up in the Zwicky Transient Facility (ZTF) Bright Transient Survey (BTS).

BTSbot contributed to the first supernova to be fully automatically discovered, confirmed, classified, and shared. (AstroNote, press release)

Presented at the ML for Astrophysics workshop at ICML 2023 (Extended abstract)

The training set for the production model is available on Zenodo.

Also see this animated walkthrough of the fully-automated BTS workflow

A multi-modal convolutional neural network

model

Fig. 5 from Rehemtulla et al. 2024

Usage

Start with the usual imports.

python import tensorflow as tf import numpy as np import pandas as pd

I've experienced weird behavior when training and running inference on the GPU cores of my M1 Mac, so we'll disable them here.

python import sys if sys.platform == "darwin": tf.config.set_visible_devices([], 'GPU')

Load some example data. It contains alerts from two sources: ZTF23abhvlji (SN 2023tyk, a bright SNIa) and ZTF23abdsfms (AT 2023sxt, an average CV).

python cand = pd.read_csv("example_data/usage_candidates.csv", index_col=None) trips = np.load("example_data/usage_triplets.npy", mmap_mode='r')

These are the metadata columns that the multi-modal BTSbot uses - order matters!

python metadata_cols = [ "sgscore1", "distpsnr1", "sgscore2", "distpsnr2", "fwhm", "magpsf", "sigmapsf", "chipsf", "ra", "dec", "diffmaglim", "ndethist", "nmtchps", "age", "days_since_peak", "days_to_peak", "peakmag_so_far", "new_drb", "ncovhist", "nnotdet", "chinr", "sharpnr", "scorr", "sky", "maxmag_so_far" ]

First, unzip BTSbot at production_models/v1.0.1.tar.gz and then proceed with loading it.

python BTSbot = tf.keras.models.load_model("production_models/best_model/")

Now run BTSbot on the example alerts!

python raw_preds = BTSbot.predict([trips, cand[metadata_cols]], verbose=1)

Rearrange the scores and compare with the scores I get. You should get a number very close to zero - some minor deviation of scores is normal.

python raw_preds = np.transpose(raw_preds)[0] print(np.median(np.abs(cand['expected_scores'] - raw_preds)))

Now BTSbot is up and running! If you have access to Kowalski you can query for new sources to run BTSbot on using download_training_data(); if not, see alert_utils() for functions to process raw triplets and compute metadata features as BTSbot expects them.

Performance

BTSbot finds nearly all SNe of interest from the input data stream (~100% completeness) with little contamination from uninteresting phenomena (93% purity) and does so as quickly as humans typically do.

test_performance.pdf

Fig. 7 from Rehemtulla et al. 2024

Citing BTSbot

If you use or reference BTSbot please cite Rehemtulla et al. 2024 (ADS).

BibTeX entry for the BTSbot paper: @ARTICLE{Rehemtulla+2024, author = {{Rehemtulla}, Nabeel and {Miller}, Adam A. and {Jegou Du Laz}, Theophile and {Coughlin}, Michael W. and {Fremling}, Christoffer and {Perley}, Daniel A. and {Qin}, Yu-Jing and {Sollerman}, Jesper and {Mahabal}, Ashish A. and {Laher}, Russ R. and {Riddle}, Reed and {Rusholme}, Ben and {Kulkarni}, Shrinivas R.}, title = "{The Zwicky Transient Facility Bright Transient Survey. III. BTSbot: Automated Identification and Follow-up of Bright Transients with Deep Learning}", journal = {\apj}, keywords = {Time domain astronomy, Sky surveys, Supernovae, Convolutional neural networks, 2109, 1464, 1668, 1938, Astrophysics - Instrumentation and Methods for Astrophysics}, year = 2024, month = sep, volume = {972}, number = {1}, eid = {7}, pages = {7}, doi = {10.3847/1538-4357/ad5666}, archivePrefix = {arXiv}, eprint = {2401.15167}, primaryClass = {astro-ph.IM}, adsurl = {https://ui.adsabs.harvard.edu/abs/2024ApJ...972....7R}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} }

Owner

  • Name: Nabeel Rehemtulla
  • Login: nabeelre
  • Kind: user

Astronomy PhD Student at CIERA, Northwestern University

Citation (CITATION.md)

If you use or reference `BTSbot` in a work, please cite our [publication](https://ui.adsabs.harvard.edu/abs/2024arXiv240115167R/abstract).

```
@ARTICLE{2024ApJ...972....7R,
       author = {{Rehemtulla}, Nabeel and {Miller}, Adam A. and {Jegou Du Laz}, Theophile and {Coughlin}, Michael W. and {Fremling}, Christoffer and {Perley}, Daniel A. and {Qin}, Yu-Jing and {Sollerman}, Jesper and {Mahabal}, Ashish A. and {Laher}, Russ R. and {Riddle}, Reed and {Rusholme}, Ben and {Kulkarni}, Shrinivas R.},
        title = "{The Zwicky Transient Facility Bright Transient Survey. III. BTSbot: Automated Identification and Follow-up of Bright Transients with Deep Learning}",
      journal = {\apj},
     keywords = {Time domain astronomy, Sky surveys, Supernovae, Convolutional neural networks, 2109, 1464, 1668, 1938, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2024,
        month = sep,
       volume = {972},
       number = {1},
          eid = {7},
        pages = {7},
          doi = {10.3847/1538-4357/ad5666},
archivePrefix = {arXiv},
       eprint = {2401.15167},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2024ApJ...972....7R},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
```

GitHub Events

Total
  • Watch event: 6
  • Delete event: 3
  • Push event: 53
  • Pull request review event: 2
  • Pull request review comment event: 4
  • Pull request event: 4
  • Fork event: 2
  • Create event: 4
Last Year
  • Watch event: 6
  • Delete event: 3
  • Push event: 53
  • Pull request review event: 2
  • Pull request review comment event: 4
  • Pull request event: 4
  • Fork event: 2
  • Create event: 4

Dependencies

requirements.txt pypi
  • PyYAML ==6.0.1
  • Requests ==2.31.0
  • astropy ==5.3.1
  • deepdiff ==6.7.1
  • fire ==0.5.0
  • keras ==2.13.1
  • matplotlib ==3.7.2
  • numpy ==1.24.3
  • pandas ==2.0.3
  • penquins ==2.2.0
  • pre_commit ==3.5.0
  • pymongo ==4.4.1
  • questionary ==2.0.1
  • scikit_learn ==1.3.0
  • tensorflow ==2.13.0
  • tqdm ==4.65.0