Skip to content

Commit

Permalink
added JOSS paper
Browse files Browse the repository at this point in the history
  • Loading branch information
kmzzhang committed Aug 13, 2019
1 parent 9c21e5f commit d197271
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
35 changes: 35 additions & 0 deletions deepCR/paper.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ARTICLE{deepcr,
author = {{Zhang}, K. and {Bloom}, J.~S.},
title = "{deepCR: Cosmic Ray Rejection with Deep Learning}",
journal = {arXiv e-prints},
archivePrefix = "arXiv",
eprint = {1907.09500},
primaryClass = "astro-ph.IM",
keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Computer Science - Computer Vision and Pattern Recognition},
year = 2019,
month = jul,
adsurl = {https://ui.adsabs.harvard.edu/abs/2019arXiv190709500Z},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{lacosmic,
author = {{van Dokkum}, P.~G.},
title = "{Cosmic-Ray Rejection by Laplacian Edge Detection}",
journal = {\pasp},
eprint = {astro-ph/0108003},
keywords = {Instrumentation: Detectors, Methods: Data Analysis-techniques: image processing},
year = 2001,
month = nov,
volume = 113,
pages = {1420-1427},
doi = {10.1086/323894},
adsurl = {https://ui.adsabs.harvard.edu/abs/2001PASP..113.1420V},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@inproceedings{pytorch,
title = {Automatic differentiation in PyTorch},
author = {Paszke, Adam and Gross, Sam and Chintala, Soumith and Chanan, Gregory and Yang, Edward and DeVito, Zachary and Lin, Zeming and Desmaison, Alban and Antiga, Luca and Lerer, Adam},
booktitle = {NIPS-Workshop},
year = {2017}
}
87 changes: 87 additions & 0 deletions paper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: 'deepCR: Cosmic Rejection with Deep Learning'
tags:
- Python
- Pytorch
- astronomy
- image processing
- cosmic ray
- deep learning

authors:
- name: Keming Zhang
orcid: 0000-0002-9870-5695
affiliation: 1 # (Multiple affiliations must be quoted)
- name: Joshua S. Bloom
orcid: 0000-0002-7777-216X
affiliation: "1, 2"
affiliations:
- name: Department of Astronomy, University of California, Berkeley
index: 1
- name: Lawrence Berkeley National Laboratory
index: 2
date: 5 August 2019
bibliography: paper.bib
---

# Summary

Astronomical imaging and spectroscopy data are frequently corrupted by
"cosmic rays" (CR) which are high energy charged particles that are instrumental,
terrestrial, or cosmic in origin. When such particles pass through solid state
detectors, such as charged coupled devices (CCDs), they create excess
flux in the pixels hit which lead to artifacts in images. These
artifacts must be identified and either masked or replaced, before
further scientific analysis could be done on the image data. It is straightforward
to identify these artifacts when multiple exposures of the same field are
taken. In such cases, a median image could be calculated from aligned single
exposures, effectively creating a CR-free image. Each one of the exposures
is then compared with the median image to identify the cosmic rays. However,
when CCD read-out times are non-negligible, or when sources of
interest are transient or variable, cosmic ray rejection with multiple
exposures can be sub-optimal or infeasible. These cases would require specialized
algorithms to detect cosmic rays in single images.

``deepCR`` is a Python package for single frame cosmic ray rejection which is
based on deep learning and written with the Pytorch framework [@pytorch].
Since ``deepCR`` is based on deep learning, different models trained on
data taken with different instrument configurations are required, when applied to different
data. The current version of ``deepCR`` is prepackaged with model for Hubble
Space Telescope ACS/WFC imaging data, and we expect models available
to grow with contribution from the community. We plan to host a "model zoo"
which enables ``deepCR`` to work across different instrument configurations.

The API of ``deepCR`` includes functionality for both applying models and
training models. To apply an available model, ``deepCR`` takes in an input image
and produces a cosmic ray mask and an "inpainted" image, with
the artifact pixels replaced with ``deepCR`` predictions. To train a new model,
users would feed in custom dataset to the training API, which is automated.
``deepCR`` works with both CPU, which is well-threaded at application time, and GPU.
On GPU, training a new model takes as short as 20 minutes,
while applying ``deepCR`` on a 10 Mpix image requires less than 0.2 second,
orders of magnitude faster than current state of the art ``LACosmic`` [@lacosmic].
![Example of cosmic ray contaminated image cutouts (first row), deepCR
cosmic ray mask predictions (middle row), and original image with artifact
pixels replaced with deepCR predictions (last row).](imgs/postage-sm.png)


In the paper accompanying ``deepCR`` [@deepcr], the authors showed that
on Hubble Space Telescope (HST) ACS/WFC data,
``deepCR`` is more robost, and at least as fast as the current
state-of-the-art single frame cosmic ray rejection package, ``LACosmic``. The API
of ``deepCR`` serve as a drop in replacement for ``LACosmic``,
so that users may experiment with different packages easily. At
reasonable false detection rates, ``deepCR`` achieved near perfect
cosmic ray detection in extragalactic and globular cluster fields, and above
90% in more difficult dense stellar fields in nearby resolved galaxies.
Since HST imaging is among the hardest cosmic ray rejection to be
solved, ``deepCR`` would work well across many different instrument set-ups,
including ground based imaging and spectroscopy. The combination of
speed and accuracy of ``deepCR`` allows astronomers to potentially save
large amounts of precious observational and computational resources.

# Acknowledgements

This work was supported by a Gordon and Betty Moore Foundation Data-Driven Discovery grant.

# References

0 comments on commit d197271

Please sign in to comment.