The following article is Open access

deepCR on ACS/WFC: Cosmic-Ray Rejection for HST ACS/WFC Photometry

, , and

Published April 2021 © 2021. The Author(s). Published by the American Astronomical Society.
, , Focus on AAS 237 Citation K. J. Kwon et al 2021 Res. Notes AAS 5 98 DOI 10.3847/2515-5172/abf6c8

2515-5172/5/4/98

Abstract

deepCR is a deep-learning-based cosmic-ray rejection algorithm previously demonstrated to be superior to state-of-the-art LACosmic on Hubble Space Telescope (HST) Advanced Camera for Surveys (ACS)/WFC F606W imaging data. In this research note, we present a new deepCR model for use on all filters of HST ACS/WFC. We train and test the model with ACS/WFC F435W, F606W, and F814W images, covering the entire spectral range of the ACS optical channel. The global model demonstrates near 100% detection rates of CRs in extragalactic fields and globular clusters and 91% in resolved galaxy fields. We further confirm the global applicability of the model by comparing its performance against single-filter models that were trained simultaneously and by testing the global model on data from another filter which was not previously used for training.

Export citation and abstract BibTeX RIS

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

1. Introduction

Cosmic-ray (CR) contamination of astronomical imaging occurs when high-energy particles with charge strike detecting devices. As well as with other space-based telescopes, Hubble Space Telescope (HST) imaging suffers contamination by CRs mainly originating from the radiation belt of the Earth. When CRs land on detectors (charged couple devices, for example), the affected pixels are deposited with significant quantities of charges, resulting in sharply high pixel values. CRs in CCD imaging have to be identified and masked, a critical component of astronomical data processing.

To date, the most widely used method for CR identification is LACosmic (van Dokkum 2001), which utilizes Laplacian edge detection technique to identify CRs based on the sharpness of their edges. However, LACosmic (as implemented on CPUs) is computationally expensive, requires ad hoc tuning of hyperparameters for each imaging and seeing mode, and shows degraded performance in crowded fields of critically sampled instruments (e.g., HST). deepCR (Zhang & Bloom 2020) is a new deep-learning-based framework for CR identification and inpainting. The efficacy of deepCR was demonstrated on HST images taken with Advanced Camera for Surveys (ACS)/WFC F606W with near 100% CR detection rates in extragalactic fields and globular clusters, and 91% in resolved galaxies, significantly outperforming LACosmic. In this research note, we present new deepCR models for HST ACS/WFC trained on F435W, F606W, and F814W imaging data. We demonstrate that the model trained simultaneously on all three filters can be used out-of-the-box on unseen filters, making the new model a global model for ACS/WFC.

2. Data

We construct the training data set in the same manner as Zhang & Bloom (2020). For the full list of the observation sets used in both data sets, we refer readers to Kwon et al. (2021). To cover the entire spectral range of the ACS/WFC, we take image sets from F435W (3605–4882 Å), F606W (4626–7179 Å), F814W (6867–9626 Å) imaging data. We select 39 observation sets for the training and 12 for the testing, where each set consists of 2–8 exposures of the same field. The data sets contain images, data quality arrays, and CR masks.

We take images from calibrated, flat-fielded, CTE-corrected single exposure files (*flc.fits). Images are chosen such that the training and test sets for each filter contain images of extragalactic fields, globular clusters, and resolved galaxies. Such choice is motivated by the fact that the difficulty of identifying CRs against normal astronomical sources scales with stellar density. Images with exposure time shorter than 100 seconds are excluded. To deploy batch training, we segment images into 256 × 256 size batches after discarding the outer 128 pixels at the edges of the images, as done in Zhang & Bloom (2020).

We obtain data quality arrays from the extension of image files. We add saturation masks for pixels brighter than 70,000e which were dilated with 7 × 7 kernels to ensure complete masking of saturation artifacts. The pixels flagged by the data quality arrays do not contribute to the training and test procedures.

Finally, we generate the CR masks of the exposures using tweakreg and astrodrizzle. The two modules align and combine multiple exposures to provide a median image without CRs, which is used to create CR masks. For further details about the module parameters used in the procedure, refer to Section 3 of Zhang & Bloom (2020).

3. Model

3.1. Model Evaluation

We evaluate the global (deepCR-ACS/WFC) and single-filter models with Receiver Operating Characteristic (ROC) curves, where we plot the true-positive rates (TPR; the model correctly identifying CRs) against the false-positive rates (FPR; the model flagging clean pixels as CRs). The models are evaluated with two settings: with and without dilation. With dilation, the predicted CR mask is expanded by a 3 × 3 kernel; if any true CR is present within the dilated area, the model is not penalized for false detection—analogous to shooting a target with a bigger caliber bullet.

We test deepCR-ACS/WFC with the three test data sets constructed for each of the single-filter models. Then, we compare the result against the performance of the single-filter models on their own test data. On all the three filter data, deepCR-ACS/WFC retains the performance of the original model (Zhang & Bloom 2020), achieving near 100% detection rates in extragalactic fields, 95% in globular clusters, and 90% in the resolved galaxies without dilation at FPR of 0.5%. At fixed FPR, Figure 1 shows that the orange curves (deepCR-ACS/WFC) give similar, if not better, TPRs compared with the black curves (single-filter models) in all the fields, where the maximum discrepancy in TPR at FPR of 0.05% is ±1%. We also evaluate the global model on images from another filter (F555W) that it is not trained with to confirm its efficacy on an unseen filter in the ACS optical channel. As shown in Figure 1(d), deepCR-ACS/WFC shows consistent performance on an unseen filter within the optical channel, which suggests global applicability to ACS optical imaging.

Figure 1.

Figure 1. The ROC curves of deepCR-ACS/WFC and individual models, tested with corresponding test data sets; (a), (b), and (c) show the ROC curves of the F435W, F606W, and F814W models, jointly with the global model. (d) Shows the test result of the global model on F555W images. The models are evaluated on three different fields—globular clusters, extragalactic fields, and resolved galaxies—and the results are shown in the first, second, and third panel, respectively. The x-axis denotes the FPR (%), and the y-axis shows the TPR (%). The result with dilation is marked with the "+" sign in the legends.

Standard image High-resolution image

3.2. Usage

The models are implemented in Python and are published in GitHub repository deepCR 1 with a benchmarking codebase deepCR-ACS-WFC_reproduction 2 . The individual and the global models are available as ACS-WFC-F435W, ACS-WFC-F606W, ACS-WFC-F814W, and ACS-WFC. The code snippet below illustrates the usage of the models.

from deepCR import deepCR

global_mdl=deepCR(mask="ACS-WFC", device="GPU")

mask, cleaned_image=global_mdl.clean(image)

4. Conclusion

We train a global deepCR model using the images taken with ACS/WFC F435W, F606W, F814W filters for use on all images from ACS/WFC. We see that the model retains the performance of the original F606W model, showing 100%, 95%, and 90% TPRs at 0.5% FPR in the extragalactic field, globular cluster, and resolved galaxy images in each single-filter test data sets. deepCR-ACS/WFC also yields similar test result compared against the individual models tested with respective data sets, showing ±1% difference in TPRs at FPR of 0.05%. We also test deepCR-ACS/WFC with images from F555W, a filter that it is not trained with, and observe consistent performance. Thus, deepCR-ACS/WFC demonstrates its efficacy for all images from ACS optical channel. We speculate that the deepCR method will work on other HST cameras, ground-based imaging, and spectroscopy when properly trained.

Software:  astropy (Astropy Collaboration et al. 2018), astrodrizzle (Hack et al. 2012), tweakreg (Gonzaga et al. 2012), numpy (Harris et al. 2020), matplotlib (Hunter 2007), scikit-image (van der Walt et al. 2014), astroscrappy (van Dokkum 2001), scipy (Virtanen et al. 2020), pytorch (Paszke et al. 2019).

Footnotes

Please wait… references are loading.
10.3847/2515-5172/abf6c8