원시데이터 수집 시스템
선정목록으로

Optimized Color Filter Array for Denoising Diffusion Null-Space Model-Based Demosaicing

관련 필름·전자재료 · (15) 디스플레이 패널재료

기본 정보

저자
  1. Indra Imanuel — Department of Computer Engineering, Dongseo University, Busan, South Korea
  2. Hyoseon Yang — Department of Mathematics, Kyung Hee University, Seoul, South Korea
  3. Sukho Lee — Department of Computer Engineering, Dongseo University, Busan, South Korea
DOI
10.1109/access.2024.3448451
저널
IEEE Access
발행년도
2024
발행기관
Institute of Electrical and Electronics Engineers
피인용수
0
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1109/access.2024.3448451
토픽
Color Science and Applications
OpenAlex ID
W4401806240

평가 내용

관련도
관련
사업분야
필름·전자재료 · (15) 디스플레이 패널재료
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > 디스플레이 패널재료' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Recently, deep learning-based demosaicing methods have shown promising results. However, there has been little research on designing CFAs that are well-suited for specific deep learning-based demosaicing methods. This is because it is challenging to establish a relationship between deep learning-based demosaicing methods and the CFAs they employ. This contrasts with traditional CFA design methods, which targeted fixed, non-deep learning demosaicing methods that did not depend on data learning, making signal processing theory applicable to the design. In this paper, we propose an optimized color filter array(CFA) tailored for the Denoising Diffusion Null-space Model (DDNM) based demosaicing. We begin by demonstrating the application of the DDNM to the demosaicing problem and establish the conditions under which the DDNM can accurately recover the true colors from CFA images containing colored pixels. Based on this analysis, we propose a CFA pattern that significantly improves the likelihood of accurate color reconstruction using the DDNM-based demosaicing method. Then, we outline the training process for obtaining the optimal filter coefficient values for the proposed CFA pattern. Experimental findings demonstrate that the proposed CFA yields favorable results when paired with the DDNM-based demosaicing technique which surpass those achieved by other CFA patterns.

본문 48,460자

본문 펼치기
Received 27 July 2024, accepted 17 August 2024, date of publication 23 August 2024, date of current version 2 September 2024. _Digital Object Identifier 10.1109/ACCESS.2024.3448451_ # Optimized Color Filter Array for Denoising Diffusion Null-Space Model-Based Demosaicing INDRA IMANUEL 1, HYOSEON YANG 2, AND SUK-HO LEE 1 1Department of Computer Engineering, Dongseo University, Busan 47011, South Korea 2Department of Mathematics, Kyung Hee University, Seoul 02447, South Korea Corresponding author: Suk-Ho Lee (petra@g.dongseo.ac.kr) This work was supported by the Basic Science Research Program through the National Research Foundation of Korea under Grant NRF-2022R1I1A3065211 and Grant NRF-2022R1F1A1066389. ABSTRACT Recently, deep learning-based demosaicing methods have shown promising results. However, there has been little research on designing CFAs that are well-suited for specific deep learning-based demosaicing methods. This is because it is challenging to establish a relationship between deep learning-based demosaicing methods and the CFAs they employ. This contrasts with traditional CFA design methods, which targeted fixed, non-deep learning demosaicing methods that did not depend on data learning, making signal processing theory applicable to the design. In this paper, we propose an optimized color filter array(CFA) tailored for the Denoising Diffusion Null-space Model (DDNM) based demosaicing. We begin by demonstrating the application of the DDNM to the demosaicing problem and establish the conditions under which the DDNM can accurately recover the true colors from CFA images containing colored pixels. Based on this analysis, we propose a CFA pattern that significantly improves the likelihood of accurate color reconstruction using the DDNM-based demosaicing method. Then, we outline the training process for obtaining the optimal filter coefficient values for the proposed CFA pattern. Experimental findings demonstrate that the proposed CFA yields favorable results when paired with the DDNM-based demosaicing technique which surpass those achieved by other CFA patterns. INDEX TERMS Image demosaicing, deep learning, denoising diffusion model, color filter array, range-null space decomposition. I. INTRODUCTION Due to limited computing resources and design constraints in digital cameras, especially in smartphones, a singlechannel sensor is typically used with a color filter array(CFA) to capture a scene. Demosaicing refers to the process of reconstructing a full color image from the single-channel sensor data, also known as the CFA image, captured by the digital camera. The aim of demosaicing is to reconstruct a high-quality color image that closely resemble the original scene. This aim can be achieved through the design of an appropriate CFA pattern and the application of sophisticated demosaicing algorithms tailored to that pattern. By optimizing both the CFA design and the corresponding demosaicing The associate editor coordinating the review of this manuscript and approving it for publication was Joewono Widjaja . process, the accuracy and quality of the reconstructed color images can be significantly improved. With traditional, non-deep learning demosaicing methods, the CFA design was based on analysis rooted in signal processing theory. For example, the authors of [2] pose the problem of color filter array design formally as one of simultaneously maximizing the spectral radii of luminance and chrominance channels subject to perfect reconstruction. Hao, et al. further extend the method in [2] to formulate an optimization problem for selecting an optimal tri-color CFA [3]. In [4], an analysis on the modulation transfer function of arbitrary pixel shapes is performed and utilized for the pixel design of the CFA. Meanwhile, advancements in deep learning-based image demosaicing techniques have demonstrated promising results when applied to Bayer CFA (color filter array) images [5], 2024 The Authors This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4 0 License [6] [7], [8]. However, demosaicing for non-Bayer patterned CFAs remains still challenging, especially when the CFA includes colored pixels. This challenge stems from the requirement to solve a linear system rather than simply interpolating data. Nonetheless, CFAs incorporating colored pixels are desired due to their potential to enhance image quality by improving the SNR (signal-to-noise) ratio. This enhancement is achievable as colored pixels allow more light to reach the sensor, thereby increasing the signal energy. Furthermore, a colored filter array can enable improved spectral sensitivity, which can be useful for specialized or scientific applications. Therefore, in this paper, we aim to design a CFA pattern that includes colored pixels and determine the CFA coefficient values so that the CFA works effectively with a deep learning-based generative model, i.e., the denoising diffusion null-space model (DDNM) for demosaicing. The challenge with CFA design for deep learning-based demosaicing is that the design of an appropriate CFA must be considered in conjunction with a learning-based model. Since the demosaicing method relies on a learned model derived from training data, establishing a rigorous relationship between the CFA and the demosaicing method becomes difficult. This difficulty has resulted in a lack of research on CFA design for deep learning-based demosaicing methods. With deep learning-based demosaicing methods, the main issue in determining the CFA pattern and the CFA coefficient values is ensuring that the CFA can guide the demosaicing network to find the optimal solution. Meanwhile, with the advancement of diffusion-based generative models [11], [12], [15], image restoration methods have begun to incorporate pre-trained diffusion models [9], [10], [13], [14]. Among the methods, the authors of [14] introduce a highly efficient zero-shot framework known as the denoising diffusion null-space Model(DDNM), which can be applied to various linear image restoration problems. In this paper, we first demonstrate how the DDNM model can be applied to the demosaicing problem by constructing the appropriate degradation matrix. However, the DDNM model cannot successfully demosaic every CFA image. For instance, when using an All-White CFA image, experimental results reveal the reconstruction of false colors. Additionally, the performance of the DDNM model fluctuates across different CFA images. Therefore, we provide a brief analysis of the conditions under which a CFA image with colored pixels can yield a unique solution, i.e., a uniquely reconstructed color image using the DDNM model. Leveraging the result of this analysis, we propose a colored CFA pattern that offers a high likelihood of accurately restoring the original color components. Furthermore, we propose a training method that can find the optimal filter coefficients that yields high-quality demosaicing outcomes when employing the DDNM as the demosaicing technique. The main contributions of this work can be summarized as follows: - We conduct an analysis to determine the conditions under which the DDNM can generate a unique solution. - Based on the analysis, we propose a CFA pattern that offers a high level of assurance in recovering the true colors from the CFA image. - We present a method for training the CFA filter coefficients to achieve optimal demosaicing results when employing the DDNM as the demosaicing method. II. PRELIMINARIES In this section, we outline the preliminaries required to understand the proposed method. _A._ _THE DEMOSAICKING PROBLEM_ Contemporary digital imaging systems frequently comprise monochrome image sensors overlaid with color filter arrays (CFAs) to capture color information. The Bayer CFA, which is the most prevailing choice among all CFAs, is composed of Red, Green, and Blue color filters. This arrangement allows for the acquisition of only one color component at each pixel, as illustrated in Fig. 1. Consider _�_ as the two-dimensional spatial domain of the image. Let I _orig_ [ k ] = [ _Rorig_ [ k ] _, Gorig_ [ k ] _, Borig_ [ k ]] <sup>_T_</sup> represent the true color image at k, while Ck = [ _cR_ [ k ] _, cG_ [ k ] _, cB_ [ k ]] is a 1 × 3 matrix that signifies the effect of the CFA. Subsequently, the intensity value _Is_ [ k ] of the Red (or Green/Blue) component detected at position k ∈ _�_ within the Bayer CFA can be mathematically represented as the inner product between Ck and I _orig_ [ k ]: _Is_ [ k ] = CkI _orig_ [ k ] _._ (1) For the Bayer CFA, the components of Ck are defined as _cR_ [ k ] = 1 _, cG_ [ k ] = 0 _, cB_ [ k ] = 0 if k ∈ _SR_ _cR_ [ k ] = 0 _, cG_ [ k ] = 1 _, cB_ [ k ] = 0 if k ∈ _SG_ _cR_ [ k ] = 0 _, cG_ [ k ] = 0 _, cB_ [ k ] = 1 if k ∈ _SB._ (2) Here, _SR_, _SG_, and _SB_ correspond to the sets of pixels containing only the Red, Green, and Blue components, respectively. The aim of demosaicing is to reconstruct I _orig_ from _Is_ . This is an underdetermined inverse problem since a three-channel image I _orig_ has to be reconstructed using the sensed image _Is_ which has only one channel. Consequently, solving the demosaicking problem requires the imposition of supplementary constraints. One common approach is to introduce the assumption that neighboring pixels exhibit comparable colors. In conventional demosaicing techniques, this assumption is employed to interpolate the absent two color components based on the spatially neighboring CFA data. Meanwhile, due to their potential to enhance image quality by reducing noise, many colored CFAs, including RGBW CFAs, have been proposed. This is because colored pixels, including white pixels, allow more light to reach the sensor. information of y . Therefore, to obtain a restored version of y, the DDNM method decomposes x 0| _t_ into its range-space part and null-space part as x 0| _t_ = A _†_ Ax 0| _t_ + ( I - A _†_ A ) x 0| _t_ and and null-space part as x 0| _t_ = A _†_ Ax 0| _t_ + ( I - A _†_ A ) x 0| _t_ and then replaces the range-space part A _†_ Ax 0| _t_ by A _†_ y at every _†_ Ax 0| _t_ + ( I - A _†_ then replaces the range-space part A _†_ Ax 0| _t_ by A _†_ y at every time step _t_ to obtain a rectified version of x 0| _t_ : _†_ Ax 0| _t_ by A _†_ y + ( I - A x ˆ 0| _t_ = A _†_ A ) x 0| _t_ _._ (8) FIGURE 1. Partial cut of a Bayer color filter array. For colored pixels, the CFA coefficient values are normally non-zeros for all color components: _cR_ [ k ] = _αR, cG_ [ k ] = _αG, cB_ [ k ] = _αB,_ (3) where _αR_ ̸ = 0, _αG_ ̸ = 0, and _αB_ ̸ = 0. For example, for a white pixel as used in [26], _αR_, _αG_, and _αB_ becomes _αR_ = 0 _._ 2936, _αG_ = 0 _._ 4905, and _αB_ = 0 _._ 2159. The demosaicing of colored pixels is more complex than the demosaicing of R, G, and B pixels, because it involves solving a linear system of equations rather than simply performing interpolation. _B._ _DENOISING DIFFUSION NULL-SPACE MODEL_ The Denoising Diffusion Null-Space Model (DDNM) method [14] tries to solve the noise-free image restoration problem y = Ax _,_ (4) where x ∈ R <sup>_D_</sup> <sup>×1</sup>, A ∈ R <sup>_d_</sup> <sup>×</sup> <sup>_D_</sup>, y ∈ R <sup>_d_</sup> <sup>×1</sup>, denote the solution image, the linear degradation operator, and the degraded image, respectively. Here, _D_ and _d_ denote the lengths of x and y, respectively. The DDNM is based on the Denoising Diffusion Implicit Model(DDIM) which starts from a noise image x _t_ = _T_, where _T_ is the total number of time steps in the forward diffusion, and converges to a clean generated image x 0 as it gots denoised by the following reverse diffusion equation, Now, as _t_ → 0, x ˆ 0| _t_ converges to the restored version of y as x ˆ 0| _t_ obeys the constraint Ax ˆ 0| _t_ = y . This is due to the fact that the range-space part when multiplied by A becomes y, i.e., AA _†_ y = y, while the null-space part when multiplied i.e., AA _†_ y = y, while the null-space part when multiplied by A becomes 0, i.e., A ( I - A _†_ A ) x 0| _t_ = 0 . The role of the by A becomes 0, i.e., A ( I - A _†_ A ) x 0| _t_ = 0 . The role of the null-space part is that it adds realness to x ˆ 0| _t_ . III. PROPOSED METHOD In this section, we first demonstrate how to apply the DDNM to the demosaicing problem. Then, we provide a brief analysis of the conditions under which the DDNM can recover the original colors, and based on this analysis, we propose a CFA pattern. Lastly, we outline the method for obtaining the optimal filter coefficients for the proposed CFA pattern. _A._ _APPLYING THE DDNM TO THE DEMOSAICING_ _PROBLEM_ The DDNM can be used to solve the demosaicking problem by letting the linear degradation matrix A to be a pixel-wise operator that converts the RGB channel pixels into CFA image pixels. That is, for every pixel k, we can define the pixel-wise operator Ak to be the action of the CFA, i.e., Ak = [ _cR_ [ k ] _, cG_ [ k ] _, cB_ [ k ]] where _cR_ [ k ], _cG_ [ k ], and _cB_ [ k ] are as defined in (5). For example, for the Red pixel we have Ak = - 1 0 0 <sup>�</sup> . For a colored pixel we have Ak = Ak = - 1 0 0 <sup>�</sup> . For a colored pixel we have Ak = - _cR_ [ k ] _cG_ [ k ] _cB_ [ k ] <sup>�</sup> = - _αR_ [ k ] _αG_ [ k ] _αB_ [ k ] <sup>�</sup>, = - _αR_ [ k ] _αG_ [ k ] _αB_ [ k ] <sup>�</sup>, - _cR_ [ k ] _cG_ [ k ] _cB_ [ k ] <sup>�</sup> = - _αR_ [ k ] _αG_ [ k ] _αB_ [ k ] <sup>�</sup>, according to (3). The problem of demosaicing for a colored pixel is to recover the original color from the given sensed (mosaiced) intensity _Is_ [ k ] = _αR_ [ k ] _Rorig_ [ k ] + _αG_ [ k ] _Gorig_ [ k ] + _αB_ [ k ] _Borig_ [ k ] for every pixel k in _�_ . To apply (8) to the demosaicking problem, y becomes _Is_ [ k ] which is now a single value. Then, the demosaiced image can be point-wisely reconstructed by using the following equation instead of (8) in the DDNM process: <u>1</u> x _t_ −1 = ~~√~~ _<u>αt</u>_ - x _t_ - _ϵ_ _θ_ ( x _t_ _, t_ ) <sup><u>1 −</u></sup> <sup>_αt_</sup> ~~√~~ 1 −¯ _<u>αt</u>_ _,_ (5) where _ϵ_ _θ_ ( x _t_ _, t_ ) denotes a neural network trained to estimate the noise in x _t_ at _t_, _αt_ is a predefined scale factor at time _t_, and _α_ ¯ _t_ = <sup>�</sup> _i_ <sup>_t_</sup> x ˆ <sup>k</sup> 0 _α_ ¯ _t_ = <sup>�</sup> _i_ <sup>_t_</sup> =0 <sup>_αi_</sup> <sup>. If we recursively apply (5), we can establish a</sup> direct relationship between x _t_ and x 0 as follows: <sup>k</sup> 0| _t_ <sup>=</sup> <sup>A</sup> _†_ k <sup>_Is_</sup> <sup>[</sup> <sup>k</sup> <sup>] + (</sup> <sup>I</sup> <sup>−</sup> <sup>A</sup> _†_ k <sup>Ak</sup> <sup>)</sup> <sup>x</sup> 0 <sup>k</sup> 0 <sup>k</sup> | _t_ <sup>_._</sup> (9) <u>1</u> x 0 = ~~√~~ _<u>α</u>_ ¯ _t_ - x _t_ - _ϵ_ _θ_ ( x _t_ _, t_ ) ~~�~~ 1 −¯ _αt_ - _._ (6) Here, x 0 should be denoted as x 0| _t_ because it is not the ideal clean image, but rather an estimate of the clean image x 0 at time _t_, so (6) becomes: <u>1</u> x 0| _t_ = ~~√~~ _<u>α</u>_ ¯ _t_ - x _t_ - _ϵ_ _θ_ ( x _t_ _, t_ ) ~~�~~ 1 −¯ _αt_ <u>�</u> _._ (7) As _t_ → 0, the image containing all the pixel values x ˆ <sup>k</sup> 0| _t_ converges to the demosaiced image. _B._ _PROPOSED CFA PATTERN GUARANTEEING UNIQUE_ _SOLUTION_ In this section, a CFA pattern that incorporates colored pixels is introduced, resulting in favorable demosaicing outcomes when the DDNM method is employed. For clarity, _Is_ [ k ] is denoted as _Is_, _αR_ [ k ], _αG_ [ k ], and _αB_ [ k ] are denoted as _αR_, _αG_, and _αB_, respectively, and _Rorig_ [ k ], _Gorig_ [ k ], and _Borig_ [ k ] are As _t_ → _T_, x 0| _t_ approaches the desired clean image. However, x 0| _t_ is not the restored version of y, as x 0| _t_ includes no denoted as _R_, _G_, and _B_ . The term ‘‘colored pixels’’ refers to pixels with non-zero filter coefficients for all color channels, i.e., _αR_ ̸ = 0, _αG_ ̸ = 0, and _αB_ ̸ = 0, implying that even a white pixel can be considered a colored pixel. It should be noted that, unlike other restoration applications, the degradation operator A is a pixel-wise operator, which varies depending on the colored pixel in the CFA. The conditions under which the DDNM can accurately reconstruct the original colors in the CFA are first identified. Using the simplified notation, (9) is rewritten as: [ _α_ 1 _, α_ 2 _, α_ 3], [ _α_ 3 _, α_ 1 _, α_ 2], and [ _α_ 2 _, α_ 3 _, α_ 1], with _α_ 1 = 1, _α_ 2 = 0, and _α_ 3 = 0. The sensed values for three different neighboring pixels, i.e., _Is_ <sup>_a_</sup> <sup>,</sup> <sup>_I_</sup> _s_ <sup>_b_</sup> <sup>, and</sup> <sup>_I_</sup> _s_ <sup>_c_</sup> <sup>will become:</sup> _s_ <sup>_a_</sup> <sup>,</sup> <sup>_I_</sup> _s_ <sup>_b_</sup> _s_ <sup>_b_</sup> <sup>, and</sup> <sup>_I_</sup> _s_ <sup>_c_</sup> _Is_ <sup>_a_</sup> <sup>,</sup> <sup>_I_</sup> _s_ <sup>_b_</sup> <sup>, and</sup> <sup>_I_</sup> _s_ <sup>_c_</sup> <sup>will become:</sup>  _Is_ <sup>_a_</sup> <sup>=</sup> <sup>_α_</sup> <sup>1</sup> <sup>_R_</sup> <sup>+</sup> <sup>_α_</sup> <sup>2</sup> <sup>_G_</sup> <sup>+</sup> <sup>_α_</sup> <sup>3</sup> <sup>_B_</sup>  (15) _Is_ <sup>_a_</sup> _Is_ <sup>_a_</sup> <sup>=</sup> <sup>_α_</sup> <sup>1</sup> <sup>_R_</sup> <sup>+</sup> <sup>_α_</sup> <sup>2</sup> <sup>_G_</sup> <sup>+</sup> <sup>_α_</sup> <sup>3</sup> <sup>_B_</sup> _Is_ <sup>_b_</sup> <sup>=</sup> <sup>_α_</sup> <sup>3</sup> <sup>_R_</sup> <sup>+</sup> <sup>_α_</sup> <sup>1</sup> <sup>_G_</sup> <sup>+</sup> <sup>_α_</sup> <sup>2</sup> <sup>_B_</sup>  _Is_ <sup>_b_</sup> <sup>=</sup> <sup>_α_</sup> <sup>3</sup> <sup>_R_</sup> <sup>+</sup> <sup>_α_</sup> <sup>1</sup> <sup>_G_</sup> <sup>+</sup> <sup>_α_</sup> <sup>2</sup> <sup>_B_</sup> _Is_ <sup>_c_</sup> <sup>=</sup> <sup>_α_</sup> <sup>2</sup> <sup>_R_</sup> <sup>+</sup> <sup>_α_</sup> <sup>3</sup> <sup>_G_</sup> <sup>+</sup> <sup>_α_</sup> <sup>1</sup> <sup>_B_</sup> _s_ <sup>_c_</sup> <sup>=</sup> <sup>_α_</sup> <sup>2</sup> <sup>_R_</sup> <sup>+</sup> <sup>_α_</sup> <sup>3</sup> <sup>_G_</sup> <sup>+</sup> <sup>_α_</sup> <sup>1</sup> <sup>_B._</sup> _†_ _Is_ + ( I - A x ˆ 0| _t_ = A _†_ A ) x 0| _t_ _,_ (10) where A = - _αR_ _αG_ _αB_ �, and A _†_, the pseudo-inverse of A, becomes: �, and A where A = - _αR_ _αG_ _αB_  The problem (12) becomes identical to the following problem, under the condition that _αR_, _αG_, and _αB_ are all nonzero: _Is_ - Ax = 0 _._ (16) FIGURE 2. Proposed CFA pattern composed of colored pixels _α_ _a_, _α_ _b_, and _α_ _c_ exhibiting cyclic properties, along with R, G, and B pixels. _†_ = <u>1</u> _αR_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _G_ <sup>2</sup> A _R_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _G_ <sup>2</sup> _G_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _B_ <sup>2</sup>   _._ (11) _B_  _αR_ _αG_ _αB_ It should be noted that x ˆ 0| _t_ represents now a pixel-wise solution, i.e., the color vector of a single pixel, rather than the entire solution image. At convergence, x 0| _t_ converges to x ˆ 0| _t_, and therefore, (10) becomes _†_ _Is_ - A Applying (16) to our three neighboring pixels, and replacing _αR_, _αG_, and _αB_ by _α_ 1, _α_ 2, and _α_ 3, and define A _a_ = - _α_ 1 _α_ 2 _α_ 3 �, A _b_ = - _α_ 3 _α_ 1 _α_ 2 �, and A _c_ = A _†_ Ax 0| _t_ = 0 _._ (12) Simplifying x 0| _t_ as x, and letting _κ_ = _αR_ <sup>2</sup> _G_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _B_ <sup>2</sup> _R_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _G_ <sup>2</sup> - _α_ 1 _α_ 2 _α_ 3 Simplifying x 0| _t_ as x, and letting _κ_ = _αR_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _G_ <sup>2</sup> <sup>+</sup> <sup>_α_</sup> _B_ <sup>2</sup> <sup>and</sup> _Is_ = _αRR_ + _αGG_ + _αBB_, we get A _a_ = - _α_ 1 _α_ 2 _α_ 3 �, A _b_ = - _α_ 3 _α_ 1 _α_ 2 �, and A _c_ = - _α_ 2 _α_ 3 _α_ 1 �, respectively, we get �, A _b_ = - _α_ 3 _α_ 1 _α_ 2 _†_ _Is_ - A �, respectively, we get A _†_ Ax _Is_ <sup>_a_</sup> <sup>−</sup> <sup>A</sup> <sup>_a_</sup> <sup>x</sup> <sup>= 0</sup> _Is_ <sup>_b_</sup> <sup>−</sup> <sup>A</sup> <sup>_b_</sup> <sup>x</sup> <sup>= 0</sup> _Is_ <sup>_c_</sup> <sup>−</sup> <sup>A</sup> <sup>_c_</sup> <sup>x</sup> <sup>= 0</sup> <sup>_._</sup> _s_ <sup>_c_</sup> <sup>−</sup> <sup>A</sup> <sup>_c_</sup> <sup>x</sup> <sup>= 0</sup> <sup>_._</sup>      _Is_ <sup>_a_</sup>  _αR_ <sup>2</sup> _R_ - _x_ 1 _G_ - _x_ 2 _B_ - _x_ 3     = <sup><u>1</u></sup> _κ_ _αR_ <sup>2</sup> _αRαG_ _αRαB_ _αGαR_ _αG_ <sup>2</sup> _αGαB_ _αGαR_ _αG_ <sup>2</sup> _αGαB_ _αBαR_ _αBαG_ _αB_ <sup>2</sup>  _B_ = Bn = 0 _,_ (13) where we let This can be re-written in matrix form as  _α_ 1 _α_ 2 _α_ 3    (17)   = 0 _._ (18)  _R_ - _x_ 1 _G_ - _x_ 2 _B_ - _x_ 3   _αR_ <sup>2</sup>  _R_ - _x_ 1 _G_ - _x_ 2 _B_ - _x_ 3 The condition for the solution x to become the sought-after solution x = - _R_ _G_ _B_ <sup>�</sup> <sup>_T_</sup>, i.e., the original color components, is outlined in the following proposition:  _α_ 1 _α_ 2 _α_ 3 _α_ 3 _α_ 1 _α_ 2 _α_ 2 _α_ 3 _α_ 1    _._ (14) B = <sup><u>1</u></sup> _κ_ _αR_ <sup>2</sup> _αRαG_ _αRαB_ _αGαR_ _αG_ <sup>2</sup> _αGαB_ _αGαR_ _αG_ <sup>2</sup> _αGαB_ _αBαR_ _αBαG_ _αB_ <sup>2</sup>   _,_ n =  _B_ If the null space solution n is the zero vector, this implies that _x_ 1 = _R_, _x_ 2 = _G_, and _x_ 3 = _B_, indicating that the solution identifies the original color components. However, achieving this relies on the invertibility of B, which is not the case, as B has a rank of 1, since each row is a multiple of the others. To derive a condition for x to ensure that the solution represents the original color components, we introduce an additional assumption, i.e., the assumption that neighboring pixels have same color components. Based on the assumption, we aim to obtain an identical solution x for neighboring pixels. Furthermore, we assume that the filter coefficients of the CFA exhibit a cyclic property, meaning that three neighboring pixels in the CFA have filter coefficients of _α_ _a_ = [ _α_ 1 _, α_ 2 _, α_ 3], _α_ _b_ = [ _α_ 3 _, α_ 1 _, α_ 2], and _α_ _c_ = [ _α_ 2 _, α_ 3 _, α_ 1]. The Bayer CFA is a special case exhibiting this cyclic property, wherein the R, G, and B pixels have filter coefficients of ̸ x = - _R_ _G_ _B_ <sup>�</sup> <sup>_T_</sup> . Proposition 1 can be easily proved by establishing the condition that (12) and (16) become identical problems and the condition that the determinant of the matrix in (18) is non-zero. Based on the analysis, we propose the CFA pattern shown in Fig. 2 to be used together with the DDNM as the demosaicing method. The filter coefficients exhibit a cyclic property for three neighboring pixels. Since the DDNM prefers natural images, an inherent constraint arises, i.e., the condition that neighboring pixels should have similar or identical colors. This constraint satisfies the condition for Proposition 1 to hold and contributes to the restoration of the original colors. _Proposition 1:_ If _α_ 1̸ = 0, _α_ 2̸ = 0, _α_ 3̸ = 0, and if _α_ 1 <sup>3</sup> <sup>+</sup> <sup>_α_</sup> 2 <sup>3</sup> <sup>+</sup> <sup>_α_</sup> 3 <sup>3</sup> ̸ <sup>=</sup> <sup>3</sup> <sup>_α_</sup> <sup>1</sup> <sup>_α_</sup> <sup>2</sup> <sup>_α_</sup> <sup>3,</sup> <sup>the</sup> <sup>solution</sup> <sup>of</sup> <sup>(18)</sup> <sup>becomes</sup> ̸ ̸ ̸ _α_ 1 <sup>3</sup> <sup>+</sup> <sup>_α_</sup> 2 <sup>3</sup> <sup>+</sup> <sup>_α_</sup> 3 <sup>3</sup> ̸ <sup>=</sup> <sup>3</sup> <sup>_α_</sup> <sup>1</sup> <sup>_α_</sup> <sup>2</sup> <sup>_α_</sup> <sup>3,</sup> <sup>the</sup> <sup>solution</sup> <sup>of</sup> <sup>(18)</sup> <sup>becomes</sup> x = - _R_ _G_ _B_ <sup>�</sup> <sup>_T_</sup> . FIGURE 3. The overall training workflow for optimizing the color filter coefficients. In addition to the colored pixels, we allocate 25% of the pixels as R, G, and B pixels. The R (or G, B) pixels serve as anchor points that retain the true R (or G, B) color components of the sensed image, thereby aiding in the discrimination of the true color components. _C._ _OPTIMIZING THE CFA COEFFICIENTS_ In this section, we demonstrate the process of obtaining the optimal filter coefficient values for the CFA pattern proposed in the previous section. We optimize the filter coefficient values _α_ 1, _α_ 2, and _α_ 3 with a gradient descent based optimization technique, the ADAM optimizer. The coefficient values are all initiated with a value of 0.333, and then updated by taking a gradient step on the mean squared error (MSE) loss between the original image I <sup>_i_</sup> _orig_ <sup>and</sup> <sup>the</sup> demosaicked image ˆ x 0| _t_ =0 in each iteration _i_ of the outer loop in Algorithm 1. That is, for every iteration _i_, we minimize the following loss function with respect to the coefficient values: <sup>_i_</sup> _orig_ <sup>−ˆ</sup> <sup>x</sup> <sup>0|</sup> <sup>_t_</sup> <sup>=0||2</sup> 2 _L_ = || I <sup>_i_</sup> <sup>2</sup> 2 <sup>_,_</sup> <sup>_i_</sup> <sup>= 1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_, . . ., N_</sup> <sup>_._</sup> (19) in identifying the noise from which the generated image originates. Our primary focus is on determining the CFA coefficients that can produce an optimal null space and range space, which ensures the high quality of the reconstructed image. Even though the pre-trained network is detached during training, the gradient can still flow through the null space and range space images. Since both the null space and range space images are functions of A, the gradient flow can update A, thereby updating the coefficients in the CFA. Since we are not tracking the denoising process during backpropagation, it is unnecessary to monitor the gradients at all the time steps in the reverse diffusion. This is because the gradient with respect to x ˆ 0| _t_ =0 remains unchanged during backpropagation. However, we still need the denoised reverse diffusion result during the forward propagation. Therefore, instead of running the full _T_ time steps originally required by the pre-trained diffusion model, we run only one-hundredth of the time steps during training, i.e., run for _t_ = _T_ _, T_ 100 _, T_ - 200 _, . . .,_ 0, where _T_ = 1000. This greatly reduces the training time. During testing, we run one-tenth of the whole time steps, i.e., run for _t_ = _T_ _, T_ - 10 _, T_ - 20 _, . . .,_ 0. Following the optimization process, the filter coefficients typically converge to _α_ 1 = 0 _._ 20504, _α_ 2 = 0 _._ 05198, and _α_ 3 = 0 _._ 74298. Occasionally, the values may rotate, for example, resulting in _α_ 2 = 0 _._ 20504, _α_ 3 = 0 _._ 05198, and _α_ 1 = 0 _._ 74298. However, the relative ratios between the coefficients remain the same, ensuring consistent performance. This rotation does not affect the overall effectiveness of the filter, as the proportional relationship between the coefficients is maintained, which is the key factor in achieving optimal results. The optimized values result from a struggle to strike a balance between robustness and accurate color reproduction. A well-conditioned matrix in (18) enhances the likelihood Additionally, the softmax function is applied to _α_ 1, _α_ 2, and _α_ 3 to constrain them within a range of 0 to 1. Figure 3 provides an overview of the training workflow, while Algorithm 1 presents the detailed pseudocode. It should be noted that the parameters of the pretrained network _ϵ_ _θ_ (·) are not updated during the optimization process. Instead, the gradient values of _ϵ_ _θ_ (·) are detached during the backpropagation as shown in Fig. 4. That is, we are not fine-tuning _ϵ_ _θ_ (·). This approach reduces memory consumption and simplifies the training process, especially considering the large number of parameters in _ϵ_ _θ_ (·). By detaching the pre-trained network during the training process, the denoising process is excluded from the backpropagation. This approach is taken because we are not interested <u>Algorithm 1</u> <u>Training Workflow for</u> _<u>α</u>_ <u>1</u> _<u>, α</u>_ <u>2</u> _<u>, α</u>_ <u>3</u> 1: Initialize : _α_ 1 _, α_ 2 _, α_ 3 ← 0 _._ 333 _,_ 0 _._ 333 _,_ 0 _._ 333, _e_ ← 10 <sup>−8</sup>, 2: _N_ ← 1000, _T_ ← 1000, _β_ 1 _, β_ 2 ← 0 _._ 9 _,_ 0 _._ 999, 3: _γ_ ← 0 _._ 001, _λ_ ← 0 _._ 001, _m_ 1 _, m_ 2 _, m_ 3 ← 0 _,_ 0 _,_ 0 (first moment), _v_ 1 _, v_ 2 _, v_ 3 _,_ ← 0 _,_ 0 _,_ 0 (second moment) 4: 5: for _i_ = 1, 2,...,N do 6: New input image : I <sup>_i_</sup> _orig_ 7: ( _α_ 1 _, α_ 2 _, α_ 3) ← Softmax( _α_ 1 _, α_ 2 _, α_ 3) 8: A ← CreateCFA( _α_ 1 _, α_ 2 _, α_ 3) - Mosaicing <sup>_i_</sup> _orig_ <sup>,</sup> <sup>A</sup> <sup>_†Is_</sup> <sup>,</sup> <sup>A</sup> <sup>_†_</sup> <sup>A</sup> 9: Compute _Is_ = AI <sup>_i_</sup> 10: _ϵ_ _θ_ ( x _t_ _, t_ ) ← Pre-trained noise predicting UNet 11: 12: DDNM based Demosaicing 13: x _T_ ∼ _N_ (0 _, I_ ) 14: for _t_ = _T_ _, T_ - 100 _, T_ - 200 _, . . .,_ 0 do 15: _ϵ_ _t_ ← _ϵ_ _θ_ ( x _t_ _, t_ ) - <u>No gradient calculated here</u> 16: x 0| _t_ ← ~~√~~ <u>1</u> _a_ ¯ <sup>(</sup> <sup>x</sup> <sup>_t_</sup> <sup>−</sup> <sup>_ϵ_</sup> <sup>_t_</sup> ~~√~~ 1 −¯ _at_ ) - _ϵ_ _t_ is detached FIGURE 4. Detaching of the pre-trained network during the optimization process. FIGURE 5. Different kinds of CFA: (a) Bayer [16] (b) Kodak [17] (c) Sony [18] (d) Yamagami [19] (e) Kaizu [20] (f) Hamilton [21] (g) Honda [22] (h) Random [23]. 1 epoch. We utilized the Adam optimizer with a learning rate( _λ_ ) of 0.001, and set the hyper-parameters ( _β_ 1, _β_ 2, etc.) as shown in Algorithm 1. We conducted qualitative and quantitative evaluations to compare the demosaicing results with other CFAs, using the DDNM as the demosaicing method for all CFAs. The CFAs we used for comparison are depicted in Fig. 5, showing various patterns with different combinations of white pixels and R, G, and B pixels. For the white pixels, we employed the coefficient values of _αR_ = 0 _._ 2936 _, αG_ = 0 _._ 4905 _, αB_ = 0 _._ 2159 as used in VEML6040 sensors from Vishay company [25], [26]. TABLE 1. Average PSNR & SSIM values of the demosaiced images using DDNM-based demosaicing with different CFA patterns. The CFA coefficient values have an influence on both the range space and the null space. The null space is formed by _a_ ¯ <sup>(</sup> <sup>x</sup> <sup>_t_</sup> <sup>−</sup> <sup>_ϵ_</sup> <sup>_t_</sup> ~~√~~ 1 −¯ _at_ ) - _ϵ_ _t_ is detached 17: x ˆ 0| _t_ ← A <sup>_†_</sup> ~~√~~ _Is_ + ( I - A <sup>_†_</sup> A ) x 0| _t_ ~~√~~ √ _<u>αt</u>_ _~~<u>(</u>~~_ <u>1−¯</u> _<u>αt</u>_ <u>−1</u> _<u>)</u>_ _α_ ¯ _<u>t</u>_ −1 _βt_ 18: x _t_ −100 = 1−¯ _<u>αt</u>_ x ˆ 0| _t_ + 1−¯ _<u>αt</u>_ x _t_ + _σt_ _ϵ_ 19: end for 18: x _t_ −100 = _α_ ¯ _<u>t</u>_ −1 _βt_ 1−¯ _<u>αt</u>_ x ˆ 0| _t_ + 20: Intermediate Output: x ˆ 0| _t_ =0 21: 22: Update _α_ 1 _, α_ 2 _, α_ 3 with Adam Optimizer 23: _gk_ ← _λ_ _<u>∂α</u>_ <sup>_<u>∂</u>_</sup> _k_ <sup>||</sup> <sup>I</sup> _orig_ <sup>_i_</sup> <sup>−ˆ</sup> <sup>x</sup> <sup>0|</sup> <sup>_t_</sup> <sup>=0||2</sup> 2 <sup>_,_</sup> <sup>_k_</sup> <sup>=1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_,_</sup> <sup>3</sup> <sup>I</sup> _orig_ <sup>_i_</sup> <sup>−ˆ</sup> <sup>x</sup> <sup>0|</sup> <sup>_t_</sup> <sup>=0||2</sup> 2 _<u>∂α</u>_ <sup>_<u>∂</u>_</sup> _k_ <sup>||</sup> <sup>I</sup> <sup>_i_</sup> 23: _gk_ ← _λ_ _<u>∂α</u>_ <sup>_<u>∂</u>_</sup> _k_ <sup>||</sup> <sup>I</sup> _orig_ <sup>_i_</sup> <sup>−ˆ</sup> <sup>x</sup> <sup>0|</sup> <sup>_t_</sup> <sup>=0||2</sup> 2 <sup>_,_</sup> <sup>_k_</sup> <sup>=1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_,_</sup> <sup>3</sup> _<u>mk</u>_ 24: _mk_ ← _β_ 1 _mk_ + (1 − _β_ 1) _gk_, _m_ ˆ _k_ ← 1− _<u>β</u>_ 1 <sup>_,_</sup> <sup>_k_</sup> <sup>=1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_,_</sup> <sup>3</sup> 25: _vk_ ← _β_ 2 _vk_ + (1 − _β_ 2) _g_ <sup>2</sup> _k_ 26: _αk_ ← _αk_ - _γ_ ~~√~~ _<u>mv</u>_ ˆˆ _kk_ <sup>2</sup> _k_ <sup>,</sup> <sup>_v_</sup> <sup>ˆ</sup> <sup>_k_</sup> <sup>←</sup> 1− _<u>vkβ</u>_ 2 <sup>_,_</sup> <sup>_k_</sup> <sup>=1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_,_</sup> <sup>3</sup> _<u>mv</u>_ ˆˆ _kk_ + _e_ <sup>_,_</sup> <sup>_k_</sup> <sup>=1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_,_</sup> <sup>3</sup> 27: end for 28: Final Output: Optimized _α_ 1 _, α_ 2 _, α_ 3 of achieving a robust numerical solution for the null-space. Such a matrix is obtained when the matrix in (18) deviates from uniformity, since this deviation increases the condition number. Meanwhile, having all non-zero values in the filter coefficient ensures the consideration of each color channel’s contribution and provides more color information per pixel. This results in cleaner and more accurate color reproduction. This roughly explains why the resulting filter coefficients exhibit non-uniformity, while still preserving information about all color components. IV. EXPERIMENTAL RESULTS We used the CelebA-HQ dataset [24] for our training and testing experiments. This dataset comprises 30,000 face images, each of size 256 × 256. The dataset is divided into a training set and a testing set with a ratio of 9:1. During training, we employed a batch size of 8, while for testing, we used a batch size of 16. The training process exclusively focuses on determining the optimal filter coefficients, while the parameters for the neural network remain fixed and are not updated during training. Each batch was trained for only FIGURE 6. Displaying the range space, the null space, and the demosaiced image obtained from various CFAs using the DDNM for demosaicing. The range space remains constant for each CFA, while the null space evolves over time. We show the null spaces for _t_ = 750 and _t_ = 0, and the corresponding reconstructed images. It should be noted that xˆ 0 | _t_ = 0 actually corresponds to only a single pixel value within the reconstructed image, but here we use it to represent all the pixels in the image. the multiplication of I - A _†_ A and x 0| _t_ . As x 0| _t_ is generated by the reverse diffusion, which favors natural images, it is FIGURE 7. Comparison of demosaiced results on the CelebA-HQ dataset with different CFAs. The All-white CFA produces false colors, while the Honda CFA occasionally generates accurate colors with fewer color artifacts compared to Bayer CFA, but results in noisier and rougher textures. Additionally, the Honda CFA fails to produce accurate colors when tested on the ImageNet dataset, as shown in Fig. 8. The Bayer CFA overly smooths the image and introduces false color artifacts. The proposed CFA offers a balanced result with smooth textures as with the Bayer CFA and fewer false color artifacts as with the Honda CFA. This results in better image quality and the highest PSNR/SSIM values. easier for the DDNM to generate a null space solution that closely resembles a natural image rather than an unnatural one. However, the null space is also restricted by the range space. If the range space limits the null space from producing a natural image, the resulting combination of null space and range space may not yield a high-quality image. Therefore, it is important for the CFA to produce a range space that allows the null space to closely resemble a natural image. Figure 6(a) and Fig. 6(b) reveal that the null space associated with CFA patterns containing non-varying colored pixels FIGURE 8. Showing the demosaicing results with the proposed CFA trained on the CelebA-HQ dataset and tested on the ImageNet dataset. All CFAs use the DDNM as the demosaicing method. (a) Original (b) Results of the All-white CFA: fails to reconstruct the true colors of the original image (c) Results of the Honda CFA: reconstructs the colors, but does not accurately reflect the true colors. (d) Results of the Bayer CFA: mostly reconstructs colors similar to the original image, but also produces false color artifacts (zoom in to see better, or refer to Fig. 9). (e) Results of the Proposed CFA: successfully reconstructs the original image’s colors without false color artifacts, achieving the highest PSNR and SSIM values. FIGURE 9. Close-up view of the demosaiced results of the images from the ImageNet and CelebA-HQ datasets. The results with the Bayer CFA exhibit some false color artifacts not present in the original image. With the proposed CFA, the details in the original images are recovered. (white pixels) tends to exhibit non-natural characteristics, attributing to the unnatural appearance of the range space. In contrast, as can be observed in Fig. 6(c) and Fig. 6(d), the null space corresponding to the Bayer CFA and the proposed optimized CFA resembles a more natural image. This is due to the fact that the cyclic pattern of the filter coefficients can better discriminate colors, resulting in a range space that already exhibits diverse colors. Consequently, the null space also showcases diverse colors, contributing to a more natural appearance. Compared with the Bayer CFA, the proposed optimized CFA contains more information of the color components, resulting in a more natural appearance of the range space. After 25 iterations ( _t_ = 750), the reconstructed image already appears quite natural with the proposed CFA, and the final reconstructed image is superior to the one reconstructed from the Bayer CFA. Table 1 presents the quantitative results, comparing the demosaicing performance of the proposed CFA with other CFAs using the DDNM method as the demosaicing method. We utilized the PSNR (Peak Signal-to-Noise Ratio) and the SSIM (Structural Similarity Index Measure) metrics for the evaluation. It can be seen in Table 1 that the proposed CFA shows the best PSNR and SSIM values. Figure 7 compares the demosaiced results on the CelebA-HQ dataset using different CFAs. The All-white CFA produces false colors. The Honda CFA generates more accurate colors with fewer color artifacts than the Bayer CFA, but results in noisier and rougher textures. Furthermore, the Honda CFA fails to produce accurate colors when tested on the ImageNet dataset, as shown in Fig. 8. The Bayer CFA overly smooths the image and introduces false color artifacts. In comparison, the proposed CFA offers a balanced result, combining the smooth textures of the results using the Bayer CFA and reduced false color artifacts of the results using the Honda CFA. This results in better image quality and the highest PSNR/SSIM values. To validate that the CFA coefficients optimized for a certain dataset also perform well with other datasets, we conducted additional experiments. We used the same CFA pattern and coefficient values, which were trained on the CelebA-HQ dataset, to test the demosaicing results on the ImageNet dataset. Figure 8 displays the demosaicing results on images from the ImageNet dataset along with the PSNR/SSIM values. The PSNR and SSIM values are slightly lower when tested on the ImageNet dataset compared to the CelebA-HQ dataset because the CFA coefficients were not specifically trained on ImageNet. If the CFA coefficients were trained on the ImageNet dataset, the PSNR/SSIM values would be higher. Nonetheless, as shown in Fig. 8, the CFA coefficients trained on one dataset still produce good results when applied to another dataset. Figure 8(b) shows the results with the All-white CFA which fails to reconstruct the true colors of the original image. The Honda CFA manages to reconstruct the colors, but they appear muted and do not accurately reflect the true colors as can be observed in Fig. 8(c). The Bayer CFA reconstruct colors similar to the original image but also produce false color artifacts as can be seen in Fig. 8(d) and in Fig. 9. In comparison, the proposed successfully reconstructs the original image’s colors without false color artifacts, achieving the highest PSNR and SSIM values. Figure 9 presents further zoomed-in images to better observe the artifacts produced by the Bayer CFA. It can be seen that the Bayer CFA sometimes introduces false colors or removes small structures, whereas the proposed CFA reproduces even the small details in the original image. V. CONCLUSION In this paper, we first demonstrated how the Denoising Diffusion Null-space Method (DDNM) can be applied to the demosaicing problem. We then analyzed the conditions under which DDNM-based demosaicing can recover the original color components. Based on this analysis, we proposed a CFA pattern tailored for DDNM-based demosaicing and outlined how to determine the optimal coefficient values for that pattern. Experimental results showed that the proposed CFA achieves superior demosaicing results with DDNM compared to other CFAs. Typically, deep learning-based demosaicing methods focus on optimizing the neural network parameters for a fixed CFA. However, we contend that the CFA itself should also be subject to adaptation in conjunction with the development of new demosaicing methodologies. This work represents the first attempt at designing CFAs for deep learning-based demosaicing methods, particularly those utilizing generative deep learning, and can serve as a reference for future research in this area. Future work for this research could explore how the proposed CFA pattern performs with other generative deep learning models beyond DDNM. Another potential direction is to develop the CFA as an output of a neural network, enabling it to adapt dynamically to changes in scene content or specific image characteristics. REFERENCES [1] R. Lukac and K. N. Plataniotis, ‘‘Color filter arrays: Design and performance analysis,’’ _IEEE_ _Trans._ _Consum._ _Electron._, vol. 51, no. 4, pp. 1260–1267, Nov. 2005. [2] K. Hirakawa and P. J. Wolfe, ‘‘Spatio-spectral color filter array design for optimal image recovery,’’ _IEEE_ _Trans._ _Image_ _Process._, vol. 17, no. 10, pp. 1876–1890, Oct. 2008. [3] P. Hao, Y. Li, Z. Lin, and E. Dubois, ‘‘A geometric method for optimal design of color filter arrays,’’ _IEEE Trans. Image Process._, vol. 20, no. 3, pp. 709–722, Mar. 2011. [4] O. Yadid-Pecht, ‘‘Geometrical modulation transfer function for dierent pixel active area shapes,’’ _Opt. Eng._, vol. 39, pp. 859–865, 2000. [5] D. Wu, Z. Xin, and C. Zhang, ‘‘A joint multi-gradient algorithm for demosaicing Bayer images,’’ in _Proc._ _8th_ _Int._ _Conf._ _Commun.,_ _Image_ _Signal Process. (CCISP)_, Chengdu, China, Nov. 2023, pp. 340–346. [6] L. Liu, X. Jia, J. Liu, and Q. Tian, ‘‘Joint demosaicing and denoising with self guidance,’’ in _Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit._ _(CVPR)_, Jun. 2020, pp. 2237–2246. [7] T. Li, A. Lahiri, Y. Dai, and O. Mayer, ‘‘Joint demosaicing and denoising with double deep image priors,’’ in _Proc. IEEE Int. Conf. Acoust., Speech_ _Signal Process. (ICASSP)_, Seoul, South Korea, Apr. 2024, pp. 4005–4009. [8] Y. Becker, R. Z. Nossek, and T. Peleg, ‘‘SDAT: Sub-dataset alternation training for improved image demosaicing,’’ _IEEE Open J. Signal Process._, vol. 5, pp. 611–620, 2024. [9] B. Fei, Z. Lyu, L. Pan, J. Zhang, W. Yang, T. Luo, B. Zhang, and B. Dai, ‘‘Generative diffusion prior for unified image restoration and enhancement,’’ in _Proc._ _IEEE/CVF_ _Conf._ _Comput._ _Vis._ _Pattern_ _Recognit._ _(CVPR)_, Los Alamitos, CA, USA, Jun. 2023, pp. 9935–9946. [10] H. Tang, T. Xie, A. Feng, H. Wang, C. Zhang, and Y. Bai, ‘‘Solving noisy inverse problems via posterior sampling: A policy gradient view-point,’’ presented at the Symbiosis Deep Learn. Differ. Equ., New Orleans, LA, USA, Dec. 2023. [11] J. Ho, A. Jain, and P. Abbeel, ‘‘Denoising diffusion probabilistic models,’’ in _Proc. NIPS_, 2020, pp. 6840–6851. [12] J. Song, C. Meng, and S. Ermon, ‘‘Denoising diffusion implicit models,’’ in _Proc. 9th Int. Conf. Learn. Represent._, 2021, pp. 6840–6851. [13] J. Song, C. Meng, and S. Ermon, ‘‘Progressive deblurring of diffusion models for coarse-to-fine image synthesis,’’ presented at the Workshop Score-Based Methods (NeurIPS Workshop), New Orleans, LA, USA, Nov. 2021. [14] Y. Wang, J. Yu, and J. Zhang, ‘‘Zero-shot image restoration using denoising diffusion null-space model,’’ in _Proc._ _11th_ _Int._ _Conf._ _Learn._ _Represent._ _(ICLR)_, Kigali, Rwanda, 2023, pp. 1–33. [15] J. Choi, S. Kim, Y. Jeong, Y. Gwon, and S. Yoon, ‘‘ILVR: Conditioning method for denoising diffusion probabilistic models,’’ in _Proc. IEEE/CVF_ _Int. Conf. Comput. Vis. (ICCV)_, Oct. 2021, pp. 14347–14356. [16] B. E. Bayer, ‘‘Color imaging array,’’ U.S. Patent 3 971 065, Jul. 20, 1976. [17] J. T. Compton and J. F. Hamilton, ‘‘Image sensor with improved light sensitivity,’’ U.S. Patent 8 139 130, Mar. 20, 2012. [18] M. Tachi, ‘‘Image processing device, image processing method, and program pertaining to image correction,’’ U.S. Patent 8 314 863, Nov. 20, 2012. [19] T. Yamagami, T. Sasaki, and A. Suga, ‘‘Image signal processing apparatus having a color filter with offset luminance filter elements,’’ U.S. Patent 5 323 233, Jun. 21, 1994. [20] S. Kaizu, ‘‘Image processing apparatus, imaging device, image processing method, and program for reducing noise or false colors in an image,’’ U.S. Patent 9 699 429, Jul. 4, 2017. [21] J. T. Compton and J. F. Hamilton, ‘‘Processing color and panchromatic pixels,’’ U.S. Patent 8 274 715, Sep. 25, 2012. [22] H. Honda, Y. Iida, Y. Egawa, and H. Seki, ‘‘A color CMOS imager with 4 × 4 white-RGB color filter array for increased low-illumination signal-tonoise ratio,’’ _IEEE Trans. Electron Devices_, vol. 56, no. 11, pp. 2398–2402, Nov. 2009. [23] P. Oh, S. Lee, and M. Kang, ‘‘Colorization-based RGB-white color interpolation using color filter array with randomly sampled pattern,’’ _Sensors_, vol. 17, no. 7, p. 1523, Jun. 2017. [24] T. Karras, T. Aila, S. Laine, and J. Lehtinen, ‘‘Progressive growing of GANs for improved quality, stability, and variation,’’ in _Proc._ _Int._ _Conf._ _Learn. Represent._, Vancouver, BC, Canada, 2018, pp. 1–26. [25] G. O. Young, ‘‘Demosaicking algorithms for RGBW color filter arrays,’’ in _Proc._ _IS&T_ _Int._ _Symp._ _Electron._ _Imag._, San Francisco, CA, USA, Feb. 2016, pp. 1–6. [26] _VEML6040 RGBW Color Sensor With I2C Interface_, Vishay Intertechnol ogy, Inc., Malvern, PA, USA, 2016. INDRA IMANUEL was born in Surabaya, Indonesia. He received the B.Comp. degree in computer engineering from the University of Surabaya, Surabaya, in 2019, and the M.S. degree in computer engineering from Dongseo University, Busan, South Korea, in 2021, where he is currently pursuing the Ph.D. degree in computer engineering. His research interests include deep learning, computer vision, generative model, and image processing. He was a recipient of the Excellent Research Award from Dongseo University, in 2022. HYOSEON YANG received the B.S., M.S., and Ph.D. degrees in mathematics from Ewha Womans University, Seoul, South Korea, in 2011, 2013, and 2017, respectively. She was a Postdoctoral Research Associate at the Department of Computational Mathematics, Science and Engineering, Michigan State University, East Lansing, MI, USA, from 2018 to 2021. She is currently working as an Assistant Professor with the Department of Mathematics, Kyung Hee University, Seoul. Her research interests include approximation theory, image processing, scientific computation, and numerical PDEs. She was a recipient of the Excellence Award in the field of mathematics at the 7th S-Oil Outstanding Thesis Awards, in 2018. SUK-HO LEE received the B.S., M.S., and Ph.D. degrees in electronics engineering from Yonsei University, Seoul, South Korea, in 1993, 1998, and 2003, respectively. He was a Researcher at the Impedance Imaging Research Center, from 2003 to 2006, and an Assistant Professor at Yonsei University, from 2006 to 2008. He has been with the Department of Computer Engineering, Dongseo University, Busan, South Korea, since 2008, where he is currently working as a Professor. He has undertaken more than ten government projects related to artificial intelligence (deep learning) over the past five years. His current research interests include deep learning, image processing, image and video filtering based on PDEs, and computer vision. He was awarded the Minister of Education Award in the field of academic promotion, in 2016.

섹션 본문 80문단 · 30,210자

(제목 없음)

1Recently, deep learning-based demosaicing methods have shown promising results.However, there has been little research on designing CFAs that are well-suited for specific deep learning-based demosaicing methods.This is because it is challenging to establish a relationship between deep learning-based demosaicing methods and the CFAs they employ.This contrasts with traditional CFA design methods, which targeted fixed, non-deep learning demosaicing methods that did not depend on data learning, making signal processing theory applicable to the design.In this paper, we propose an optimized color filter array(CFA) tailored for the Denoising Diffusion Null-space Model (DDNM) based demosaicing.We begin by demonstrating the application of the DDNM to the demosaicing problem and establish the conditions under which the DDNM can accurately recover the true colors from CFA images containing colored pixels.Based on this analysis, we propose a CFA pattern that significantly improves the likelihood of accurate color reconstruction using the DDNM-based demosaicing method.Then, we outline the training process for obtaining the optimal filter coefficient values for the proposed CFA pattern.Experimental findings demonstrate that the proposed CFA yields favorable results when paired with the DDNM-based demosaicing technique which surpass those achieved by other CFA patterns.INDEX TERMS Image demosaicing, deep learning, denoising diffusion model, color filter array, range-null space decomposition.

I. INTRODUCTION

2Due to limited computing resources and design constraints in digital cameras, especially in smartphones, a singlechannel sensor is typically used with a color filter array(CFA) to capture a scene.Demosaicing refers to the process of reconstructing a full color image from the single-channel sensor data, also known as the CFA image, captured by the digital camera.The aim of demosaicing is to reconstruct a high-quality color image that closely resemble the original scene.This aim can be achieved through the design of an appropriate CFA pattern and the application of sophisticated demosaicing algorithms tailored to that pattern.By optimizing both the CFA design and the corresponding demosaicing

3The associate editor coordinating the review of this manuscript and approving it for publication was Joewono Widjaja .process, the accuracy and quality of the reconstructed color images can be significantly improved.

4With traditional, non-deep learning demosaicing methods, the CFA design was based on analysis rooted in signal processing theory.For example, the authors of [2] pose the problem of color filter array design formally as one of simultaneously maximizing the spectral radii of luminance and chrominance channels subject to perfect reconstruction.Hao, et al. further extend the method in [2] to formulate an optimization problem for selecting an optimal tri-color CFA [3].In [4], an analysis on the modulation transfer function of arbitrary pixel shapes is performed and utilized for the pixel design of the CFA.

5Meanwhile, advancements in deep learning-based image demosaicing techniques have demonstrated promising results when applied to Bayer CFA (color filter array) images [5], [6] [7], [8].However, demosaicing for non-Bayer patterned CFAs remains still challenging, especially when the CFA includes colored pixels.This challenge stems from the requirement to solve a linear system rather than simply interpolating data.Nonetheless, CFAs incorporating colored pixels are desired due to their potential to enhance image quality by improving the SNR (signal-to-noise) ratio.This enhancement is achievable as colored pixels allow more light to reach the sensor, thereby increasing the signal energy.Furthermore, a colored filter array can enable improved spectral sensitivity, which can be useful for specialized or scientific applications.Therefore, in this paper, we aim to design a CFA pattern that includes colored pixels and determine the CFA coefficient values so that the CFA works effectively with a deep learning-based generative model, i.e., the denoising diffusion null-space model (DDNM) for demosaicing.

6The challenge with CFA design for deep learning-based demosaicing is that the design of an appropriate CFA must be considered in conjunction with a learning-based model.Since the demosaicing method relies on a learned model derived from training data, establishing a rigorous relationship between the CFA and the demosaicing method becomes difficult.This difficulty has resulted in a lack of research on CFA design for deep learning-based demosaicing methods.With deep learning-based demosaicing methods, the main issue in determining the CFA pattern and the CFA coefficient values is ensuring that the CFA can guide the demosaicing network to find the optimal solution.

7Meanwhile, with the advancement of diffusion-based generative models [11], [12], [15], image restoration methods have begun to incorporate pre-trained diffusion models [9], [10], [13], [14].Among the methods, the authors of [14] introduce a highly efficient zero-shot framework known as the denoising diffusion null-space Model(DDNM), which can be applied to various linear image restoration problems.

8In this paper, we first demonstrate how the DDNM model can be applied to the demosaicing problem by constructing the appropriate degradation matrix.However, the DDNM model cannot successfully demosaic every CFA image.For instance, when using an All-White CFA image, experimental results reveal the reconstruction of false colors.Additionally, the performance of the DDNM model fluctuates across different CFA images.Therefore, we provide a brief analysis of the conditions under which a CFA image with colored pixels can yield a unique solution, i.e., a uniquely reconstructed color image using the DDNM model.Leveraging the result of this analysis, we propose a colored CFA pattern that offers a high likelihood of accurately restoring the original color components.Furthermore, we propose a training method that can find the optimal filter coefficients that yields high-quality demosaicing outcomes when employing the DDNM as the demosaicing technique.

9The main contributions of this work can be summarized as follows:

10• We conduct an analysis to determine the conditions under which the DDNM can generate a unique solution.

11• Based on the analysis, we propose a CFA pattern that offers a high level of assurance in recovering the true colors from the CFA image.

12• We present a method for training the CFA filter coefficients to achieve optimal demosaicing results when employing the DDNM as the demosaicing method.

II. PRELIMINARIES

13In this section, we outline the preliminaries required to understand the proposed method.

A. THE DEMOSAICKING PROBLEM

14Contemporary digital imaging systems frequently comprise monochrome image sensors overlaid with color filter arrays (CFAs) to capture color information.The Bayer CFA, which is the most prevailing choice among all CFAs, is composed of Red, Green, and Blue color filters.This arrangement allows for the acquisition of only one color component at each pixel, as illustrated in Fig. 1.Consider as the two-dimensional spatial domain of the image.Let

15] is a 1 × 3 matrix that signifies the effect of the CFA.Subsequently, the intensity value I s [k] of the Red (or Green/Blue) component detected at position k ∈ within the Bayer CFA can be mathematically represented as the inner product between C k and I orig [k]:

16For the Bayer CFA, the components of C k are defined as

17Here, S R , S G , and S B correspond to the sets of pixels containing only the Red, Green, and Blue components, respectively.The aim of demosaicing is to reconstruct I orig from I s .This is an underdetermined inverse problem since a three-channel image I orig has to be reconstructed using the sensed image I s which has only one channel.Consequently, solving the demosaicking problem requires the imposition of supplementary constraints.One common approach is to introduce the assumption that neighboring pixels exhibit comparable colors.In conventional demosaicing techniques, this assumption is employed to interpolate the absent two color components based on the spatially neighboring CFA data.

18Meanwhile, due to their potential to enhance image quality by reducing noise, many colored CFAs, including RGBW CFAs, have been proposed.This is because colored pixels, including white pixels, allow more light to reach the sensor.

19117336 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.For colored pixels, the CFA coefficient values are normally non-zeros for all color components:

20where α R ̸ = 0, α G ̸ = 0, and α B ̸ = 0.For example, for a white pixel as used in [26], α R , α G , and α B becomes α R = 0.2936, α G = 0.4905, and α B = 0.2159.The demosaicing of colored pixels is more complex than the demosaicing of R, G, and B pixels, because it involves solving a linear system of equations rather than simply performing interpolation.

B. DENOISING DIFFUSION NULL-SPACE MODEL

21The Denoising Diffusion Null-Space Model (DDNM) method [14] tries to solve the noise-free image restoration problem

22where x ∈ R D×1 , A ∈ R d×D , y ∈ R d×1 , denote the solution image, the linear degradation operator, and the degraded image, respectively.Here, D and d denote the lengths of x and y, respectively.The DDNM is based on the Denoising Diffusion Implicit Model(DDIM) which starts from a noise image x t=T , where T is the total number of time steps in the forward diffusion, and converges to a clean generated image x 0 as it gots denoised by the following reverse diffusion equation,

23where ϵ θ (x t , t) denotes a neural network trained to estimate the noise in x t at t, α t is a predefined scale factor at time t, and ᾱt = t i=0 α i .If we recursively apply (5), we can establish a direct relationship between x t and x 0 as follows:

24Here, x 0 should be denoted as x 0|t because it is not the ideal clean image, but rather an estimate of the clean image x 0 at time t, so (6) becomes:

25As t → T , x 0|t approaches the desired clean image.However, x 0|t is not the restored version of y, as x 0|t includes no information of y.Therefore, to obtain a restored version of y, the DDNM method decomposes x 0|t into its range-space part and null-space part as

26then replaces the range-space part A † Ax 0|t by A † y at every time step t to obtain a rectified version of x 0|t :

27Now, as t → 0, x0|t converges to the restored version of y as x0|t obeys the constraint Ax 0|t = y.This is due to the fact that the range-space part when multiplied by A becomes y, i.e., AA † y = y, while the null-space part when multiplied by A becomes 0, i.e., A(I − A † A)x 0|t = 0.The role of the null-space part is that it adds realness to x0|t .

III. PROPOSED METHOD

28In this section, we first demonstrate how to apply the DDNM to the demosaicing problem.Then, we provide a brief analysis of the conditions under which the DDNM can recover the original colors, and based on this analysis, we propose a CFA pattern.Lastly, we outline the method for obtaining the optimal filter coefficients for the proposed CFA pattern.

A. APPLYING THE DDNM TO THE DEMOSAICING PROBLEM

29The DDNM can be used to solve the demosaicking problem by letting the linear degradation matrix A to be a pixel-wise operator that converts the RGB channel pixels into CFA image pixels.That is, for every pixel k, we can define the pixel-wise operator A k to be the action of the CFA, i.e.,

30, and c B [k] are as defined in (5).For example, for the Red pixel we have A k = 1 0 0 .For a colored pixel we have

31The problem of demosaicing for a colored pixel is to recover the original color from the given sensed (mosaiced) intensity [k] for every pixel k in .To apply (8) to the demosaicking problem, y becomes I s [k] which is now a single value.Then, the demosaiced image can be point-wisely reconstructed by using the following equation instead of (8) in the DDNM process:

32As t → 0, the image containing all the pixel values xk 0|t converges to the demosaiced image.

B. PROPOSED CFA PATTERN GUARANTEEING UNIQUE SOLUTION

33In this section, a CFA pattern that incorporates colored pixels is introduced, resulting in favorable demosaicing outcomes when the DDNM method is employed.For clarity, The term ''colored pixels'' refers to pixels with non-zero filter coefficients for all color channels, i.e., α R ̸ = 0, α G ̸ = 0, and α B ̸ = 0, implying that even a white pixel can be considered a colored pixel.It should be noted that, unlike other restoration applications, the degradation operator A is a pixel-wise operator, which varies depending on the colored pixel in the CFA.The conditions under which the DDNM can accurately reconstruct the original colors in the CFA are first identified.Using the simplified notation, ( 9) is rewritten as:

34where and A † , the pseudo-inverse of A, becomes:

35It should be noted that x0|t represents now a pixel-wise solution, i.e., the color vector of a single pixel, rather than the entire solution image.At convergence, x 0|t converges to x0|t , and therefore, (10) becomes

36Simplifying x 0|t as x, and letting

37where we let

38If the null space solution n is the zero vector, this implies that x 1 = R, x 2 = G, and x 3 = B, indicating that the solution identifies the original color components.However, achieving this relies on the invertibility of B, which is not the case, as B has a rank of 1, since each row is a multiple of the others.

39To derive a condition for x to ensure that the solution represents the original color components, we introduce an additional assumption, i.e., the assumption that neighboring pixels have same color components.Based on the assumption, we aim to obtain an identical solution x for neighboring pixels.Furthermore, we assume that the filter coefficients of the CFA exhibit a cyclic property, meaning that three neighboring pixels in the CFA have filter coefficients of

40The problem (12) becomes identical to the following problem, under the condition that α R , α G , and α B are all nonzero: Applying ( 16) to our three neighboring pixels, and replacing α R , α G , and α B by α 1 , α 2 , and α 3 , and define

41This can be re-written in matrix form as

42The condition for the solution x to become the sought-after solution x = R G B T , i.e., the original color components, is outlined in the following proposition:

43Proposition 1 can be easily proved by establishing the condition that ( 12) and ( 16) become identical problems and the condition that the determinant of the matrix in (18) is non-zero.Based on the analysis, we propose the CFA pattern shown in Fig. 2 to be used together with the DDNM as the demosaicing method.The filter coefficients exhibit a cyclic property for three neighboring pixels.Since the DDNM prefers natural images, an inherent constraint arises, i.e., the condition that neighboring pixels should have similar or identical colors.This constraint satisfies the condition for Proposition 1 to hold and contributes to the restoration of the original colors.In addition to the colored pixels, we allocate 25% of the pixels as R, G, and B pixels.The R (or G, B) pixels serve as anchor points that retain the true R (or G, B) color components of the sensed image, thereby aiding in the discrimination of the true color components.

C. OPTIMIZING THE CFA COEFFICIENTS

44In this section, we demonstrate the process of obtaining the optimal filter coefficient values for the CFA pattern proposed in the previous section.We optimize the filter coefficient values α 1 , α 2 , and α 3 with a gradient descent based optimization technique, the ADAM optimizer.The coefficient values are all initiated with a value of 0.333, and then updated by taking a gradient step on the mean squared error (MSE) loss between the original image I i orig and the demosaicked image x0|t=0 in each iteration i of the outer loop in Algorithm 1.That is, for every iteration i, we minimize the following loss function with respect to the coefficient values:

45Additionally, the softmax function is applied to α 1 , α 2 , and α 3 to constrain them within a range of 0 to 1. Figure 3 provides an overview of the training workflow, while Algorithm 1 presents the detailed pseudocode.

46It should be noted that the parameters of the pretrained network ϵ θ (•) are not updated during the optimization process.Instead, the gradient values of ϵ θ (•) are detached during the backpropagation as shown in Fig. 4.That is, we are not fine-tuning ϵ θ (•).This approach reduces memory consumption and simplifies the training process, especially considering the large number of parameters in ϵ θ (•).

47By detaching the pre-trained network during the training process, the denoising process is excluded from the backpropagation.This approach is taken because we are not interested in identifying the noise from which the generated image originates.Our primary focus is on determining the CFA coefficients that can produce an optimal null space and range space, which ensures the high quality of the reconstructed image.Even though the pre-trained network is detached during training, the gradient can still flow through the null space and range space images.Since both the null space and range space images are functions of A, the gradient flow can update A, thereby updating the coefficients in the CFA.

48Since we are not tracking the denoising process during backpropagation, it is unnecessary to monitor the gradients at all the time steps in the reverse diffusion.This is because the gradient with respect to x0|t=0 remains unchanged during backpropagation.However, we still need the denoised reverse diffusion result during the forward propagation.Therefore, instead of running the full T time steps originally required by the pre-trained diffusion model, we run only one-hundredth of the time steps during training, i.e., run for t = T , T − 100, T − 200, . . ., 0, where T = 1000.This greatly reduces the training time.During testing, we run one-tenth of the whole time steps, i.e., run for t = T , T − 10, T − 20, . . ., 0.

49Following the optimization process, the filter coefficients typically converge to α 1 = 0.20504, α 2 = 0.05198, and α 3 = 0.74298.Occasionally, the values may rotate, for example, resulting in α 2 = 0.20504, α 3 = 0.05198, and α 1 = 0.74298.However, the relative ratios between the coefficients remain the same, ensuring consistent performance.This rotation does not affect the overall effectiveness of the filter, as the proportional relationship between the coefficients is maintained, which is the key factor in achieving optimal results.

50The optimized values result from a struggle to strike a balance between robustness and accurate color reproduction.A well-conditioned matrix in (18) enhances the likelihood x T ∼ N (0, I )

51▷ No gradient calculated here 16:

5218:

53end for 20:

54Intermediate Output: x0|t=0

21: 22:

55Update α 1 , α 2 , α 3 with Adam Optimizer

56, k=1,2,3 27: end for 28: Final Output: Optimized α 1 , α 2 , α 3 of achieving a robust numerical solution for the null-space.Such a matrix is obtained when the matrix in (18) deviates from uniformity, since this deviation increases the condition number.Meanwhile, having all non-zero values in the filter coefficient ensures the consideration of each color channel's contribution and provides more color information per pixel.This results in cleaner and more accurate color reproduction.This roughly explains why the resulting filter coefficients exhibit non-uniformity, while still preserving information about all color components.

IV. EXPERIMENTAL RESULTS

57We used the CelebA-HQ dataset [24] for our training and testing experiments.This dataset comprises 30,000 face images, each of size 256 × 256.The dataset is divided into a training set and a testing set with a ratio of 9:1.During training, we employed a batch size of 8, while for testing, we used a batch size of 16.The training process exclusively focuses on determining the optimal filter coefficients, while the parameters for the neural network remain fixed and are not updated during training.Each batch was trained for only

FIGURE 5.

58Different kinds of CFA: (a) Bayer [16] (b) Kodak [17] (c) Sony [18] (d) Yamagami [19] (e) Kaizu [20] (f) Hamilton [21] (g) Honda [22] (h) Random [23].

591 epoch.We utilized the Adam optimizer with a learning rate(λ) of 0.001, and set the hyper-parameters (β 1 , β 2 , etc.) as shown in Algorithm 1.

60We conducted qualitative and quantitative evaluations to compare the demosaicing results with other CFAs, using the DDNM as the demosaicing method for all CFAs.The CFAs we used for comparison are depicted in Fig. 5, showing various patterns with different combinations of white pixels and R, G, and B pixels.For the white pixels, we employed the coefficient values of α R = 0.2936, α G = 0.4905, α B = 0.2159 as used in VEML6040 sensors from Vishay company [25], [26].The CFA coefficient values have an influence on both the range space and the null space.The null space is formed by 117340 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.easier for the DDNM to generate a null space solution that closely resembles a natural image rather than an unnatural one.However, the null space is also restricted by the range space.If the range space limits the null space from producing a natural image, the resulting combination of null space and range space may not yield a high-quality image.Therefore, it is important for the CFA to produce a range space that allows the null space to closely resemble a natural image.(white pixels) tends to exhibit non-natural characteristics, attributing to the unnatural appearance of the range space.In contrast, as can be observed in Fig. 6(c) and Fig. 6(d), the null space corresponding to the Bayer CFA and the proposed optimized CFA resembles a more natural image.This is due to the fact that the cyclic pattern of the filter coefficients can better discriminate colors, resulting in a range space that already exhibits diverse colors.Consequently, the null space also showcases diverse colors, contributing to a more natural appearance.Compared with the Bayer CFA, the proposed optimized CFA contains more information of the color components, resulting in a more natural appearance of the range space.After 25 iterations (t = 750), the reconstructed image already appears quite natural with the proposed CFA, and the final reconstructed image is superior to the one reconstructed from the Bayer CFA.

61Table 1 presents the quantitative results, comparing the demosaicing performance of the proposed CFA with other CFAs using the DDNM method as the demosaicing method.We utilized the PSNR (Peak Signal-to-Noise Ratio) and the SSIM (Structural Similarity Index Measure) metrics for the evaluation.It can be seen in Table 1 that the proposed CFA shows the best PSNR and SSIM values.

62Figure 7 compares the demosaiced results on the CelebA-HQ dataset using different CFAs.The All-white 117342 VOLUME 12, 2024 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

63CFA produces false colors.The Honda CFA generates more accurate colors with fewer color artifacts than the Bayer CFA, but results in noisier and rougher textures.Furthermore, the Honda CFA fails to produce accurate colors when tested on the ImageNet dataset, as shown in Fig. 8.The Bayer CFA overly smooths the image and introduces false color artifacts.In comparison, the proposed CFA offers a balanced result, combining the smooth textures of the results using the Bayer CFA and reduced false color artifacts of the results using the Honda CFA.This results in better image quality and the highest PSNR/SSIM values.

64To validate that the CFA coefficients optimized for a certain dataset also perform well with other datasets, we conducted additional experiments.We used the same CFA pattern and coefficient values, which were trained on the CelebA-HQ dataset, to test the demosaicing results on the ImageNet dataset.Figure 8 displays the demosaicing results on images from the ImageNet dataset along with the PSNR/SSIM values.The PSNR and SSIM values are slightly lower when tested on the ImageNet dataset compared to the CelebA-HQ dataset because the CFA coefficients were not specifically trained on ImageNet.If the CFA coefficients were trained on the ImageNet dataset, the PSNR/SSIM values would be higher.Nonetheless, as shown in Fig. 8, the CFA coefficients trained on one dataset still produce good results when applied to another dataset.Figure 8(b) shows the results with the All-white CFA which fails to reconstruct the true colors of the original image.The Honda CFA manages to reconstruct the colors, but they appear muted and do not accurately reflect the true colors as can be observed in Fig. 8(c).The Bayer CFA reconstruct colors similar to the original image but also produce false color artifacts as can be seen in Fig. 8(d) and in Fig. 9.In comparison, the proposed successfully reconstructs the original image's colors without false color artifacts, achieving the highest PSNR and SSIM values.

65Figure 9 presents further zoomed-in images to better observe the artifacts produced by the Bayer CFA.It can be seen that the Bayer CFA sometimes introduces false colors or removes small structures, whereas the proposed CFA reproduces even the small details in the original image.

V. CONCLUSION

66In this paper, we first demonstrated how the Denoising Diffusion Null-space Method (DDNM) can be applied to the demosaicing problem.We then analyzed the conditions under which DDNM-based demosaicing can recover the original color components.Based on this analysis, we proposed a CFA pattern tailored for DDNM-based demosaicing and outlined how to determine the optimal coefficient values for that pattern.Experimental results showed that the proposed CFA achieves superior demosaicing results with DDNM compared to other CFAs.Typically, deep learning-based demosaicing methods focus on optimizing the neural network parameters for a fixed CFA.However, we contend that the CFA itself should also be subject to adaptation in conjunction with the development of new demosaicing methodologies.This work represents the first attempt at designing CFAs for deep learning-based demosaicing methods, particularly those utilizing generative deep learning, and can serve as a reference for future research in this area.Future work for this research could explore how the proposed CFA pattern performs with other generative deep learning models beyond DDNM.Another potential direction is to develop the CFA as an output of a neural network, enabling it to adapt dynamically to changes in scene content or specific image characteristics.

FIGURE 1 .

67FIGURE 1. Partial cut of a Bayer color filter array.

68and α B [k] are denoted as α R , α G , and α B , respectively, and R orig [k], G orig [k], and B orig [k] are denoted as R, G, and B.

69, and α c = [α 2 , α 3 , α 1 ].The Bayer CFA is a special case exhibiting this cyclic property, wherein the R, G, and B pixels have filter coefficients of [α 1 , α 2 , α 3 ], [α 3 , α 1 , α 2 ], and [α 2 , α 3 , α 1 ], with α 1 = 1, α 2 = 0, and α 3 = 0.The sensed values for three different neighboring pixels, i.e., I a s , I b s , and I c s will become:

FIGURE 2 .

70FIGURE 2. Proposed CFA pattern composed of colored pixels α a , α b , and α c exhibiting cyclic properties, along with R, G, and B pixels.

FIGURE 3 .

71FIGURE 3. The overall training workflow for optimizing the color filter coefficients.

Algorithm 1 1 : 4 : 5 : 9 :

72Training Workflow for α 1 , α 2 , α 3 Initialize: α 1 , α 2 , α 3 ← 0.333, 0.333, 0.333, e ← 10 −8 , 2: N ← 1000, T ← 1000, β 1 , β 2 ← 0.9, 0.999, 3: γ ← 0.001, λ ← 0.001, m 1 , m 2 , m 3 ← 0, 0, 0 (first moment), v 1 , v 2 , v 3 , ← 0, 0, 0 (second moment) for i = 1, 2,. . .,N do , α 2 , α 3 ) ← Softmax(α 1 , α 2 , α 3 ) 8:A ← CreateCFA(α 1 , α 2 , α 3 ) ▷ Mosaicing Compute I s = AI i orig , A † I s , A † A 10:ϵ θ (x t , t) ← Pre-trained noise predicting UNet

14 :

73for t = T , T − 100, T − 200, . . ., 0 do 15:

FIGURE 4 .

74FIGURE 4. Detaching of the pre-trained network during the optimization process.

FIGURE 6 .

75FIGURE 6. Displaying the range space, the null space, and the demosaiced image obtained from various CFAs using the DDNM for demosaicing.The range space remains constant for each CFA, while the null space evolves over time.We show the null spaces for t = 750 and t = 0, and the corresponding reconstructed images.It should be noted that x0|t=0 actually corresponds to only a single pixel value within the reconstructed image, but here we use it to represent all the pixels in the image.

FIGURE 7 .

76FIGURE 7. Comparison of demosaiced results on the CelebA-HQ dataset with different CFAs.The All-white CFA produces false colors, while the Honda CFA occasionally generates accurate colors with fewer color artifacts compared to Bayer CFA, but results in noisier and rougher textures.Additionally, the Honda CFA fails to produce accurate colors when tested on the ImageNet dataset, as shown in Fig. 8.The Bayer CFA overly smooths the image and introduces false color artifacts.The proposed CFA offers a balanced result with smooth textures as with the Bayer CFA and fewer false color artifacts as with the Honda CFA.This results in better image quality and the highest PSNR/SSIM values.

Figure 6 (

77a) and Fig. 6(b) reveal that the null space associated with CFA patterns containing non-varying colored pixels

FIGURE 8 .

78FIGURE 8. Showing the demosaicing results with the proposed CFA trained on the CelebA-HQ dataset and tested on the ImageNet dataset.All CFAs use the DDNM as the demosaicing method.(a) Original (b) Results of the All-white CFA: fails to reconstruct the true colors of the original image (c) Results of the Honda CFA: reconstructs the colors, but does not accurately reflect the true colors.(d) Results of the Bayer CFA: mostly reconstructs colors similar to the original image, but also produces false color artifacts (zoom in to see better, or refer to Fig. 9).(e) Results of the Proposed CFA: successfully reconstructs the original image's colors without false color artifacts, achieving the highest PSNR and SSIM values.

FIGURE 9 .

79FIGURE 9. Close-up view of the demosaiced results of the images from the ImageNet and CelebA-HQ datasets.The results with the Bayer CFA exhibit some false color artifacts not present in the original image.With the proposed CFA, the details in the original images are recovered.

TABLE 1 .

80Average PSNR & SSIM values of the demosaiced images using DDNM-based demosaicing with different CFA patterns.

참고문헌 14건

  1. Geometrical modulation transfer function for different pixel active area shapes Optical Engineering · SPIE · 2000 10.1117/1.602462
  2. A Color CMOS Imager With 4 $\times$ 4 White-RGB Color Filter Array for Increased Low-Illumination Signal-to-Noise Ratio IEEE Transactions on Electron Devices · Institute of Electrical and Electronics Engineers · 2009 10.1109/ted.2009.2030630
  3. A Geometric Method for Optimal Design of Color Filter Arrays IEEE Transactions on Image Processing · Institute of Electrical and Electronics Engineers · 2010 10.1109/tip.2010.2077642
  4. Spatio-Spectral Color Filter Array Design for Optimal Image Recovery IEEE Transactions on Image Processing · Institute of Electrical and Electronics Engineers · 2008 10.1109/tip.2008.2002164
  5. Demosaicking algorithms for RGBW color filter arrays. Color Imaging: Displaying, Processing, Hardcopy, and Applications · 2016
  6. Colorization-Based RGB-White Color Interpolation using Color Filter Array with Randomly Sampled Pattern Sensors · Multidisciplinary Digital Publishing Institute · 2017 10.3390/s17071523
  7. Joint Demosaicing and Denoising With Self Guidance 2020 10.1109/cvpr42600.2020.00231
  8. Color filter arrays: design and performance analysis IEEE Transactions on Consumer Electronics · Institute of Electrical and Electronics Engineers · 2005 10.1109/tce.2005.1561853
  9. ILVR: Conditioning Method for Denoising Diffusion Probabilistic Models 2021 IEEE/CVF International Conference on Computer Vision (ICCV) · 2021 10.1109/iccv48922.2021.01410
  10. Progressive Deblurring of Diffusion Models for Coarse-to-Fine Image Synthesis arXiv (Cornell University) · Cornell University · 2022 10.48550/arxiv.2207.11192
  11. Generative Diffusion Prior for Unified Image Restoration and Enhancement 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) · 2023 10.1109/cvpr52729.2023.00958
  12. A Joint Multi-Gradient Algorithm for Demosaicing Bayer Images 2022 7th International Conference on Communication, Image and Signal Processing (CCISP) · 2023 10.1109/ccisp59915.2023.10355783
  13. Joint Demosaicing And Denoising With Double Deep Image Priors 2024 10.1109/icassp48485.2024.10448384
  14. SDAT: Sub-Dataset Alternation Training for Improved Image Demosaicing IEEE Open Journal of Signal Processing · Institute of Electrical and Electronics Engineers · 2024 10.1109/ojsp.2024.3395179