Method for removing cosmic rays in a multiple-exposure image superposition
By improving the method for removing cosmic rays from multiple exposure images and utilizing subsample statistics and voting mechanisms, the problems of missed and false removal of cosmic rays in existing technologies are solved, achieving a higher precision in cosmic ray removal.
Patent Information
- Application Number
- CN202211437697.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-12-10
- Filing Date
- 2022-11-17
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2042-11-17
AI Technical Summary
Among existing methods for removing cosmic rays from multiple exposure images, the Drizzle method has a high median value, which leads to severe omission of cosmic rays, while the full sample statistical method has a high false removal rate, making it difficult to effectively control the omission and false removal rate of cosmic rays.
An improved alignment pixel average algorithm is adopted, combined with a voting mechanism, to align multiple exposure images of the same sky location. Subsample statistics and nonlinear least squares are used to fit Gaussian curves, and a threshold is set to identify and remove cosmic rays.
It significantly reduced the omission and false removal rates of cosmic rays, improved the accuracy of image processing, and achieved a more accurate cosmic ray removal effect.
Smart Images

Figure CN116029917B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology in astronomy, specifically a method for removing cosmic rays in multiple exposure image overlay. Background Technology
[0002] We know that space is filled with many 10⁻⁶ particles due to the frequent occurrence of various extreme high-energy events. 3 -10 23 Low- to high-energy particles in the eV range are why some scientists call space an ideal high-energy laboratory. However, for space-based telescopes, cosmic rays formed by these high-energy particles are a major source of contamination in astronomical observation images. For single-exposure images, cosmic ray removal is generally done by comparing the image with pixels surrounding the cosmic rays. In recent years, machine learning methods have been developed, but these depend on the algorithm and training samples. Because cosmic rays can merge with bright sources in the field of view, single-exposure methods are generally ineffective at removing cosmic rays. In multi-exposure images, cosmic rays can be removed using image subtraction or statistical methods. We first define pixels at the same sky location with different exposures as aligned pixels at that location. Different exposure images will have differences in displacement and rotation angles. For example, the Drizzle package (Fruchter2001) used in the Hubble Space Telescope's multi-exposure image overlay processing uses the aligned pixel median method combined with the comparison of simulated exposures and the original image to remove cosmic rays. The Chandrasekhar X-ray telescope, on the other hand, uses the full sample statistic of aligned pixels to average the data and then remove the pixel flux greater than a certain threshold (e.g., 3 times the standard deviation 3σ, which is considered to be cosmic rays).
[0003] Both of the above solutions have their drawbacks:
[0004] 1) The Drizzle method only uses the median of aligned pixels. However, this value is actually too high for cases without cosmic rays because the aligned pixels are hit by cosmic rays at a higher flux level. This deficiency becomes particularly pronounced in cases with dense cosmic rays. Furthermore, the next step involves simulating observations, further convolving the pixelation effect to influence surrounding pixels and increasing computational cost. For more information on the Drizzle method, see Fruchter, AS & Hook, RN2002, PASP, 114, 144 and Fruchter, AS2011, PASP, 123, 497-502.
[0005] 2) Full sample statistic uses the average value of all aligned pixels, which allows cosmic rays to affect the average value. This method can lead to significant omissions, especially for images with few exposures.
[0006] In view of the shortcomings of the above two schemes, the present invention improves the average value algorithm of aligned pixels and introduces a new "voting mechanism" to determine the retention or rejection of cosmic rays. Summary of the Invention
[0007] The technical objective of this invention is to address the shortcomings of existing technologies by providing a new method that is more reasonable than existing technologies, capable of distinguishing cosmic rays, and controlling both the miss rate and false miss rate at a more ideal level.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] A method for removing cosmic rays in multiple exposure image stacking, characterized by comprising the following steps:
[0010] Step 1: Align the N exposed images obtained by N exposures of the same sky position to a target grid with the same resolution as the exposed images, where N>2 and is a positive integer;
[0011] Step 2: Identify and remove cosmic ray contamination pixels from the observed pixels in each exposed image, specifically including:
[0012] Step 2.1: For a specific grid pixel of the target grid, select all observed pixels in each exposure image whose overlap with that grid pixel is greater than a preset threshold as the full sample of that grid pixel, and calculate the median F of the pixel values of all grid pixels in the full sample. median The square root of the median is taken as the standard deviation σ. median ;
[0013] Let a certain grid pixel be grid pixel (m, n), where the x-coordinate and y-coordinate of grid pixel m and n in the target grid are both integers;
[0014] Step 2.2: Filter the entire sample of target grid pixels (m, n), removing pixels with values less than F. median +rσ median The observed pixels are selected as subsamples of the pixels in the grid, where r is the selection coefficient and r is a real number;
[0015] Step 2.3: When the number of observed pixels contained in the subsample is not less than the preset minimum sample size, the pixel values of the subsample are fitted to a Gaussian curve using the nonlinear least squares method, and the average value F is calculated. mean and standard deviation σ mean When the number of observed pixels contained in a subsample is less than the preset minimum sample size, let the average value F be... mean =F median Standard deviation σmean =σ median ;
[0016] Step 2.4: Set a threshold F mean +βσ mean Each observed pixel in the full sample is evaluated individually. If the pixel value of an observed pixel is less than F... mean +βσ mean Then, the observed pixel receives one non-cosmic ray trust vote, where β is the threshold coefficient and β is a real number.
[0017] Step 2.5: Repeat steps 2.1 to 2.4 to traverse all grid pixels of the target grid and calculate the threshold F corresponding to each grid pixel. mean +βσ mean And complete the voting for the observed pixels of the full sample for each grid pixel;
[0018] Step 2.6: Statistically analyze the voting results. For observation pixels that receive 0 trust votes for non-cosmic ray pixels, determine them as cosmic ray contaminated pixels and remove them.
[0019] Step 3: Overlay the exposure images of each pixel after removing cosmic ray contamination onto the target grid to obtain the target observation image.
[0020] Based on the above solutions, even better solutions include:
[0021] Furthermore, in step 2.1, the threshold is 10%.
[0022] Furthermore, in step 2.4, the value of β is within the range of 3-6.
[0023] Furthermore, in step 2, the minimum sample size is 5.
[0024] Furthermore, the steps for removing cosmic ray contamination pixels in step 2.6 are as follows:
[0025] Suppose that the cosmic ray contaminated pixels have undergone S rounds of voting, where S is a positive integer not less than 1;
[0026] Obtain the average value F of the cosmic ray contaminated pixels in a certain round of voting. mean and standard deviation σ mean Choose based on this average value F mean and standard deviation σ mean The pixel values of the cosmic ray contaminated pixels are replaced by random samples from a defined Gaussian distribution.
[0027] As a preferred approach, the grid pixel with the highest overlap with the cosmic ray contamination pixel can be selected, and the average value F corresponding to its subsample can be obtained. mean and standard deviation σ mean And select based on the average value F mean and standard deviation σ mean The pixel values of the cosmic ray contaminated pixels are replaced by random samples from a defined Gaussian distribution.
[0028] Alternatively, obtain the average value F of the polluted pixels in each round of voting. mean and standard deviation σ mean And based on that average value F mean and standard deviation σ mean The determined random sample values from a Gaussian distribution are used to calculate a weighted average of all the obtained random sample values. The weighted average is then used to replace the pixel value of the contaminated pixel.
[0029] Beneficial effects:
[0030] The method of this invention is characterized by using a subsample that reduces cosmic rays for statistical analysis, thus yielding more accurate means and standard deviations. Furthermore, it employs a voting method to avoid false removal of cosmic rays in certain regions; therefore, it can also be called a "subsample statistical voting method for removing cosmic rays." Compared to existing technologies, the advantages of this invention are:
[0031] 1) It avoids the unreasonable use of the median instead of the mean in the Drizzle method, and also avoids the crude method of directly using sample I (the whole sample) to make the mean. It reduces the contamination of the statistical results by cosmic rays at the high flow end in sample I, and can obtain a more accurate mean and standard deviation of the flow of aligned pixels. This lays the foundation for the subsequent judgment of cosmic rays and filling of cosmic ray contaminated pixels.
[0032] 2) The voting mechanism minimizes misjudgment of cosmic rays. Due to the rotation and displacement differences between different exposures, a certain observed pixel may cover different target grids. A pixel at a certain position of a target grid that exceeds the local flow threshold may not exceed the local flow threshold in the pixel statistics of the adjacent target grids it covers. Such pixels were removed in previous work, but we retain them, which improves the accuracy of image processing. This situation is particularly prominent in areas with large flow variations. Attached Figure Description
[0033] Figure 1In the middle, the top left image is the 5th of 16 samples (No. 5), which is a superposition of 100 simulated observation images from the China Space Station Survey Telescope (CSST); the top right image is the result after subtracting cosmic rays using the full sample statistical method, with the remaining white dots representing erroneously removed cosmic rays and the black dots representing missed cosmic rays; the bottom left image is the result after subtracting cosmic rays using the Drizzle method; and the bottom right image shows the effect of subtracting cosmic rays using a specific implementation scheme of this invention.
[0034] Figure 2 The graph compares the overall error rates of the three cosmic ray removal methods. The vertical axis represents the overall error rate, which is the percentage of all cosmic rays that were mistakenly removed plus those that were missed, out of the total number of cosmic rays. The horizontal axis represents the sample numbers of 16 sky regions, each exposed 100 times and then superimposed with the sample numbers of the cosmic ray removal samples. The fluctuations of the curve are related to the number of bright sources in the observation area and the density of cosmic rays. Detailed Implementation
[0035] The technical solution of the present invention will be explained in more detail below, and the technical effects of the present invention will be demonstrated in conjunction with the accompanying drawings and specific test examples.
[0036] This invention discloses a method for removing cosmic rays in multiple exposure image overlay, the specific implementation process of which includes the following steps:
[0037] Step 1: Align the N exposed images obtained by N exposures of the same sky position to a target grid with the same resolution as the exposed images (all exposed images have the same resolution), where N>2 and is a positive integer;
[0038] exist Figure 1 In the test case shown, N = 100;
[0039] Step 2: Identify and remove cosmic ray contamination pixels from the observed pixels in each exposed image. This step specifically includes the following sub-steps:
[0040] Step 2.1: For a specific grid pixel (m, n) of the target grid, select all observed pixels in each exposure image whose overlap with that grid pixel is greater than a preset threshold as the full sample of that grid pixel, and calculate the median F of the full sample pixel values. median The square root of the median is taken as the standard deviation σ. median m and n are both integers, representing the x-coordinate and y-coordinate of the grid pixel in the target grid coordinate system, respectively;
[0041] The pixel value represents the number of photons collected by the pixel during the exposure time. One pixel is equivalent to one photon counter. It is assumed here that the photon flux of the bright source during the exposure time follows a Poisson distribution. The pixel overlap refers to the percentage of the area of the target grid pixel that overlaps with the observation pixel when the observation pixel is resampled by the target grid pixel. The threshold can generally be set to 10%, and can be adjusted in practice according to the specific imaging effect through experiments.
[0042] Step 2.2: Filter the entire sample of target grid pixels (m, n), removing pixels with values less than F. median +rσ median The observed pixels are selected as subsamples of grid pixels (m, n). The r is a selection coefficient, which is a real number parameter set by humans. The value of r should ensure that the subsample contains as many pixels as possible that are not contaminated by cosmic rays.
[0043] In practice, the appropriate value of r can be adjusted based on the final imaging effect and obtained through multiple experiments. The main factors to consider during adjustment include the following two aspects:
[0044] Firstly, the choice of r is related to the amount of cosmic rays in the exposure. Generally speaking, the denser the cosmic rays, the smaller the value of r should be, or even a negative value (that is, r can be a positive or negative number).
[0045] For example, when the cosmic rays distributed in the exposed image occupy about 10% of the image area, the value of the r coefficient is 1. When the proportion of cosmic rays in the actual obtained exposed image is higher (the denser the cosmic rays), the r coefficient can be considered to be lower; when the proportion is smaller, the r coefficient can be considered to be higher.
[0046] Secondly, since the density of cosmic rays is not uniform in space, and the cosmic rays at the same location may be different in different exposures, the value of r should be relatively conservative to ensure that the subsample contains as few cosmic rays as possible.
[0047] Step 2.3: When the number of observed pixels in a subsample is not less than the preset minimum sample size, typically 5, the pixel values of the subsample are fitted to a Gaussian curve using the nonlinear least squares method, and the average value F is calculated. mean and standard deviation σ mean When the number of observed pixels contained in a subsample is less than the preset minimum sample size, let F... mean =F median , σ mean =σ median ;
[0048] The minimum sample size is the minimum number of individuals that a subsample must contain;
[0049] Step 2.4: Set a threshold Fmean +βσ mean For each observed pixel in the full sample of the target grid pixel (m, n), a judgment is made. Taking the observed pixel (k, i, j) in the i-th row and j-th column of the full sample from the k-th exposure image as an example, if the pixel value of the observed pixel (k, i, j) is less than F... mean +βσ mean Then the observed pixel (k,i,j) gets 1 non-cosmic ray trust vote; where β is the threshold coefficient for judging whether the observed pixel is a cosmic ray contaminated pixel, which can generally be selected in the range of 3-6, including the two extreme values of 3 and 6. In practice, the specific value can be adjusted according to the imaging effect. k, i and j are all integers, and 1≤k≤N.
[0050] Step 2.5: Repeat steps 2.1 to 2.4 to traverse all grid pixels of the target grid and calculate the threshold F corresponding to each grid pixel. mean +βσ mean And complete the voting for the observed pixels of the full sample for each grid pixel;
[0051] Step 2.6: Statistically analyze the voting results. For observation pixels that receive 0 votes for non-cosmic ray confidence, they are identified as cosmic ray contaminated pixels, marked, and then removed.
[0052] Step 3: Overlay the exposure images of each pixel after removing cosmic ray contamination onto the target grid to obtain the target observation image.
[0053] In the above process, since each observed pixel may overlap with multiple grid pixels, it may receive multiple votes. However, as long as the observed pixel receives one non-cosmic ray trust vote in any round of voting, it will not be deleted to reduce the probability of accidental deletion.
[0054] In step 2.6, the method for removing cosmic ray contamination pixels can be any one of the following two methods:
[0055] Suppose that the cosmic ray contaminated pixels have gone through S rounds of voting, where S is a positive integer not less than 1;
[0056] Option 1: Obtain the average value F of the cosmic ray contaminated pixels in a certain round of voting. mean and standard deviation σ mean Choose based on this average value F mean and standard deviation σ mean The pixel value of the cosmic ray contaminated pixel is replaced by any random sampled value from a defined Gaussian distribution.
[0057] In practice, the grid pixels with the highest overlap with the cosmic ray contamination pixels can be selected first, and the average value F corresponding to their subsamples can be obtained. mean and standard deviation σ mean Then select based on that average value F mean and standard deviation σ mean The pixel values of the contaminated pixels are replaced by random samples from a defined Gaussian distribution;
[0058] Option 2: Obtain the average value F of the cosmic ray contaminated pixels in each round of voting. mean and standard deviation σ mean And based on that average value F mean and standard deviation σ mean The determined random sample values from a Gaussian distribution are used to calculate a weighted average of all the obtained random sample values. The weighted average is then used to replace the pixel value of the contaminated pixel.
[0059] The weight coefficient of each random sample value is related to the degree of overlap. The random sample value corresponding to the Gaussian distribution of the subsample of the grid pixel with the highest degree of overlap with the cosmic ray contaminated pixel has the highest weight. When its weight ratio reaches 100%, it is equivalent to the preferred implementation scheme of scheme one.
[0060] In existing technologies, image overlay methods, besides the Drizzle method, include shift-and-add and interlace methods. However, the Drizzle method considers more factors compared to shift-and-add and interlace, resulting in more accurate and reasonable overlay results, and is therefore more versatile. It has already been used in image overlay for the Hubble Telescope, the James Webb Space Telescope, and other projects. Therefore, newly developed algorithms are mostly compared with the Drizzle algorithm. The method in this embodiment is an improvement on the Drizzle method. During the multi-exposure image overlay process, it improves the average pixel averaging algorithm and introduces a voting mechanism to achieve cosmic ray removal. The method of this invention is more reasonable than the two existing methods described in the background art, can more accurately distinguish cosmic rays, and can control the omission rate and false removal rate to a more ideal level.
[0061] Since actual observations do not provide the number of cosmic rays input, the lack of control samples affects the assessment of cosmic rays. Therefore, we chose simulation data to implement specific schemes and compare the effects of cosmic ray processing. In this test, we selected simulation data from the upcoming China Space Station Survey Telescope (CSST) (from the Shanghai Astronomical Observatory, Chinese Academy of Sciences). All necessary instrument and observational effects have been included, and most importantly, the number of cosmic rays included is known. We obtained exposure data for 16 sky regions, 100 images per region, for a total of 1600 exposures. We then performed cosmic ray removal on the 100 exposures for each sky region using the previously developed Drizzle method, the full-sample statistic method, and our own developed method.
[0062] Figure 1 The top left image is the fifth of 16 exposure data samples (No. 5), which is an observation image obtained by overlaying 100 simulated observation images from the China Space Station Survey Telescope (CSST).
[0063] Figure 1 In the upper right corner, the full sample statistical method increases the average value and widens the variance because it uses pixels containing cosmic rays in aligned pixels, thus underestimating the number of cosmic rays and failing to adequately remove them.
[0064] Figure 1 In the lower left corner, the traditional Drizzle method suffers from a smoothing effect (pixelated smoothing) due to resampling, which causes the resampled value to be lower than the ideal value, resulting in an over-removal of cosmic rays, or erroneous removal.
[0065] Figure 1 In the lower right corner, the method of this invention, on the one hand, accurately estimates the mean and variance by removing some subsamples of cosmic rays, and on the other hand, retains pixels that might be mistakenly removed as cosmic rays through a voting method. Therefore, the overall error (omission + mistaken removal) is the lowest.
[0066] according to Figure 2 As shown, in this test, the overall error rate of the full sample statistical method and the Drizzle method was about 4%-5%, while the method of this invention can reduce the overall error rate to about 1%, which is 4-5 times lower than before.
[0067] Based on the comprehensive statistical analysis of test results using exposure data samples from the aforementioned 16 sky regions, the overall error rate of cosmic ray removal in the example of applying this invention to the simulation image processing of the Chinese Space Station Survey Telescope (CSST) was reduced to approximately 20% of that of previous methods. In the 16 tests, the cosmic ray removal threshold parameters used by the three methods were the same; the method of this invention used a value of approximately 1 for the r-coefficient and a value between 3 and 6 for β. The example results demonstrate that the method of this invention is more suitable for processing future observational data of the CSST than previous work—the full-sample statistical method and the Drizzle method.
[0068] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should be considered within the scope of protection of the present invention.
Claims
1. A method for removing cosmic rays in multi-exposure image stacking, characterized in that, Includes the following steps: Step 1: Align the N exposed images obtained by N exposures of the same sky position to a target grid with the same resolution as the exposed images, where N>2 and is a positive integer; Step 2: Identify and remove cosmic ray contamination pixels from the observed pixels in each exposed image, specifically including: Step 2.1: For a specific grid pixel of the target grid, select all observed pixels in each exposure image whose overlap with that grid pixel is greater than a preset threshold as the full sample of that grid pixel, and calculate the median F of the pixel values of all grid pixels in the full sample. median The square root of the median is taken as the standard deviation σ. median ; Let a certain grid pixel be grid pixel (m, n), where m and n are the x-coordinate and y-coordinate of the grid pixel in the target grid, both of which are integers; Step 2.2: Filter the entire sample of target grid pixels (m, n), removing pixels with values less than F. median +rσ median The observed pixels are selected as subsamples of the pixels in the grid, where r is the selection coefficient and r is a real number; Step 2.3: When the number of observed pixels contained in the subsample is not less than the preset minimum sample size, the pixel values of the subsample are fitted to a Gaussian curve using the nonlinear least squares method, and the average value F is calculated. mean and standard deviation σ mean When the number of observed pixels contained in a subsample is less than the preset minimum sample size, let the average value F be... mean =F median Standard deviation σ mean =σ median ; Step 2.4: Set a threshold F mean +βσ mean Each observed pixel in the full sample is evaluated individually. If the pixel value of an observed pixel is less than F... mean +βσ mean Then, the observed pixel receives one non-cosmic ray trust vote, where β is the threshold coefficient and β is a real number. Step 2.5: Repeat steps 2.1 to 2.4 to traverse all grid pixels of the target grid and calculate the threshold F corresponding to each grid pixel. mean +βσ mean And complete the voting for the observed pixels of the full sample for each grid pixel; Step 2.6: Statistically analyze the voting results. For observation pixels that receive 0 trust votes for non-cosmic ray pixels, determine them as cosmic ray contaminated pixels and remove them. Step 3: Overlay the exposure images of each pixel after removing cosmic ray contamination onto the target grid to obtain the target observation image.
2. The method for removing cosmic rays in multiple exposure image overlay according to claim 1, characterized in that, In step 2.1, the threshold is 10%.
3. The method for removing cosmic rays in multiple exposure image overlay according to claim 1, characterized in that, In step 2.4, the value of β is within the range of 3-6.
4. The method for removing cosmic rays in multiple exposure image overlay according to claim 1, characterized in that, In step 2, the minimum sample size is 5.
5. A method for removing cosmic rays in multiple exposure image stacking according to any one of claims 1-4, characterized in that, The steps for removing cosmic ray contamination pixels in step 2.6 are as follows: Suppose that the cosmic ray contaminated pixels have undergone S rounds of voting, where S is a positive integer not less than 1; Obtain the average value F of the cosmic ray contaminated pixels in a certain round of voting. mean and standard deviation σ mean Choose based on this average value F mean and standard deviation σ mean The pixel values of the cosmic ray contaminated pixels are replaced by random samples from a defined Gaussian distribution.
6. The method for removing cosmic rays in multiple exposure image stacking according to claim 5, characterized in that: Select the grid pixel with the highest overlap with the cosmic ray contamination pixel and obtain the average value F corresponding to its subsample. mean and standard deviation σ mean Choose based on this average value F mean and standard deviation σ mean The pixel values of the cosmic ray contaminated pixels are replaced by random samples from a defined Gaussian distribution.
7. A method for removing cosmic rays in multiple exposure image stacking according to any one of claims 1-4, characterized in that, The steps for removing cosmic ray contamination pixels in step 2.6 are as follows: Suppose that the cosmic ray contaminated pixels have undergone S rounds of voting, where S is a positive integer not less than 1; Obtain the average value F of the cosmic ray contaminated pixels in each round of voting. mean and standard deviation σ mean And based on that average value F mean and standard deviation σ mean The determined random sample values from a Gaussian distribution are used to calculate a weighted average of all the obtained random sample values. This weighted average is then used to replace the pixel values of the cosmic ray contaminated pixels.