Processing RGB Color Sensors for Measuring the Circadian Stimulus of Artiﬁcial and Daylight Light Sources

Featured Application: Accurate practical measurements of the circadian effectiveness of daylight and artiﬁcial light sources using RGB color sensors for future human-centered lighting control. Abstract: The three main tasks of modern lighting design are to support the visual performance, satisfy color emotion (color quality), and promote positive non-visual outcomes. In view of large-scale applications, the use of simple and inexpensive RGB color sensors to monitor related visual and non-visual illumination parameters seems to be of great promise for the future development of human-centered lighting control systems. In this context, the present work proposes a new methodology to assess the circadian effectiveness of the prevalent lighting conditions for daylight and artiﬁcial light sources in terms of the physiologically relevant circadian stimulus (CS) metric using such color sensors. In the case of daylight, the raw sensor readouts were processed in such a way that the CIE daylight model can be applied as an intermediate step to estimate its spectral composition, from which CS can eventually be calculated straightforwardly. Maximal CS prediction errors of less than 0.0025 were observed when tested on real data. For artiﬁcial light sources, on the other hand, the CS approximation method of Truong et al. was applied to estimate its circadian effectiveness from the sensor readouts. In this case, a maximal CS prediction error of 0.028 must be reported, which is considerably larger compared to daylight, but still in an acceptable range for typical indoor lighting applications. The use of RGB color sensors is thus shown to be suitable for estimating the circadian effectiveness of both types of illumination with sufﬁcient accuracy for practical applications.


Introduction
Solid-state lighting considerably increased the possibilities and allowed for a reinterpretation of modern lighting design. The development and use of light-emitting diodes (LEDs), in contrast to conventional light sources, has yielded significant advantages in terms of lifetime, energy savings, environmental benefits, controllability, and spectral tunability [1,2]. Over the past few years, scientific and technological progress in the design of LEDs, including significant improvements in the selection of suitable semiconductor material combinations, the topology of the lattice grid and quantum well structures, the chip packaging, and the coating materials [3][4][5][6][7][8], has led to high luminous efficacies of 150 lm W −1 and beyond, depending on the desired level of color quality [9][10][11]. Typically, an increase in color rendering capabilities, e.g., expressed in terms of the CIE color rendering index (CRI) R a [12][13][14] or the ANSI/IES TM-30-20 R f metric [15], occurs at the expense of luminous efficacy so that an adequate trade-off between color quality considerations and energy savings has to be found [16]. Thus, numerous studies have been conducted pursuing the goal of optimizing the spectral compositions of multi-channel LED light sources for achieving an optimal color rendering while still maintaining a sufficiently high level of luminous efficacy [17][18][19][20][21][22][23][24][25][26][27][28][29][30]. At the same time, such multi-channel LED solutions allow for a dynamic adjustment of the lighting conditions to satisfy the users' visual, emotional, and biological needs in support of positive human outcomes [31][32][33][34][35][36].
Despite these recent technological and conceptual advances in LED and LED-based lighting design, properly dealing with mixed lighting conditions in environments where daylight entry through windows supplements the artificial lighting conditions still poses a defying challenge. Optimizing the latter in some sort of closed-feedback loop under the impact of a second, dynamically changing (daylight) light source defines a difficult regulation problem that so far has only been considered rudimentarily in the literature. A crucial aspect in this context is the proper monitoring of the indoor and outdoor lighting conditions with regard to the lighting parameters most relevant for an appropriate system control to always satisfy certain pre-defined visual and non-visual requirements. In experimental test settings, these kinds of data can be generated straightforwardly by using expensive spectroradiometers or other sophisticated measurement devices. However, in view of large-scale applications, where such "laboratory" devices are not an option due to budgetary constraints, the use of simple and inexpensive RGB color sensors to be applied for this purpose appears to be quite promising [37][38][39][40][41], yet requires a suitable processing of the sensor readouts in order to obtain meaningful measures that can eventually be used as the input for an adequate lighting control [42].
In this context, the present work focuses on the circadian aspects of lighting by proposing a novel sensor-based methodology to assess the circadian effectiveness of the prevalent lighting conditions caused by artificial and daylight light sources using RGB color sensors. As discussed by Babilon et al. [43], circadian effectiveness in lighting can be measured by the physiologically relevant circadian stimulus (CS) metric introduced by Rea and Figueiro [44]. In order to facilitate its application for the lighting practitioner, Truong et al. [45,46] recently published a family of computational approximation methods that can be used to calculate a lighting condition's CS based on a few easy-to-perform measurements using standard equipment. As will be shown in this work, the sensor readouts of an RGB color sensor, after some suitable processing, can likewise be used as the input for Truong et al.'s approximation method to determine the CS of artificial light sources. For daylight conditions, on the other hand, the RGB output in combination with the CIE daylight model [47] can be used to estimate the corresponding spectral power distributions (SPDs), from which the CS values can be calculated without further approximations by directly applying Rea et al.'s original model.

Circadian Stimulus and Its Approximation
The hormone melatonin has proven to be an excellent and widely used biomarker for assessing how light affects the human circadian system . In two independent studies, Brainard et al. [58] and Thapan et al. [59], for example, consistently found that the action spectrum for light-induced nocturnal melatonin suppression peaks at 460 nm with an approximately 110 nm broad absorption band at half-maximum sensitivity. Even though the results of both studies were in good agreement over much of the probed wavelength regime, an obvious discontinuity was found in the datasets at about 505 nm, i.e., at a wavelength that would appear as a unique green stimulus causing the spectrally opponent retinal blue versus yellow (b-y) color mechanism to signal zero. As argued by Rea et al. [44,83,84], no single retinal photoreceptor model is capable of adequately describing these observations on the spectral dependencies of melatonin suppression. Instead, all known photoreceptors, including rods, cones, and intrinsically photosensitive retinal ganglion cells (ipRGCs), must be taken into account by explicitly considering their neuroanatomical, neurophysiological, and operational characteristics in order to properly model the experimental findings of human circadian phototransduction [85,86]. Under these prerequisites, Rea et al. [44], by pooling the available nocturnal melatonin suppression data, were able to develop the most complete model of the spectral sensitivity of the human circadian system that, in contrast to single-photopigmentbased approaches (e.g., the calculation of α-opic quantities [87][88][89], equivalent melanopic lux [90,91], etc.), is capable of adequately describing spectral opponency effects [62,63,73]. Based on their model formalism, Rea et al. introduced a new measure called circadian light CL A , which basically gives the model-weighted irradiance. In order to quantify the circadian effectiveness of arbitrary lighting conditions, they further defined the CS metric, which represents the functional relationship between the CL A measure and its theoretically provoked melatonin suppression in percent. The CS metric has already been applied successfully in various laboratory and field studies to predict non-visual effects in lighting [92][93][94][95][96][97][98][99][100][101][102][103][104], confirming its physiological relevance.
In order to facilitate the CS calculation for the lighting practitioner, Truong et al. [45,46] recently published a family of computational approximation methods. While the first method models CS as a function of illuminance E v and the chromaticity coordinate z of the 2°standard observer, both measured vertically at eye level, the second method substitutes the latter by using the correlated color temperature (CCT) instead. Although performing CCT measurements is common practice in standard lighting design, which was the main reason for proposing the second approximation method, Truong et al. [46] stated that the CS estimation based on this quantity becomes significantly inaccurate for lighting conditions with CCTs ranging from 3220 K to 3710 K and, therefore, is not recommended to be applied in this range. In contrast, an excellent agreement with Rea et al.'s original CS model could be confirmed for the complete range of relevant CCTs when applying the first approximation method. The maximum prediction error |∆CS| max calculated on a comprehensive database of measured SPDs representing both artificial and daylight light sources was found to be less than 0.058 [45]. Therefore, the latter should be used in this work, in particular, since under the assumption that the Luther-Yves condition [42,[105][106][107][108] is met sufficiently, a direct mapping from the color sensor's RGB output to the corresponding CIE XYZ tristimulus values and, thus, to the required z coordinate given by z = Z/(X + Y + Z) can be established. The corresponding model expression is given by: and has been validated for white light sources in the range from 10 lx up to 10,000 lx. It should be noted that the discontinuity at z = 0.195 represents the spectral opponency effect of the b-y mechanism as discussed above. Equation (1) has been applied successfully for the estimation of CS values in a couple of recently published field studies conducted by Babilon et al. that were intended to provide reliable field measurements of the circadian effectiveness of the prevalent lighting conditions in an office [43] and nursing home environment [109].

Processing of RGB Color Sensors
This section summarizes the necessary processing steps that are required to be applied to simple RGB color sensors to be used for CS measurements. They include (i) the measurement and determination of the sensors' spectral sensitivity curves and (ii) the optimization and application of a suitable color correction matrix in order to properly map the sensors' measured RGB output to standardized CIE XYZ coordinates. In addition, a short introduction to the physical structure and working principle of RGB color sensors is given.

Physical Structure and Working Principle of RGB Color Sensors
An RGB color sensor basically comprises three main components including the underlying semiconductor structure of the photodiodes, the array of optical filters defining its spectral sensitivity, and the electronic circuit used for signal readout [110]. Its physical principle is illustrated in Figure 1. As incident light hits the surface of the RGB color sensor, it is filtered by the red, green, and blue optical bandpass filters attached to the photodiode layer, which combines at least three single photodiodes, i.e., one for each color channel. Without the bandpass filters, a typical silicon photodiode would be sensitive to wavelengths from the ultra-violet up to the infrared region with an absorption maximum located in the range from 800 nm to 950 nm. The different transmissive color filters are therefore intended to reshape and optimize the spectral response of the color sensor to mimic the trichromatic vision capabilities of the human eye. The correspondingly transmitted photons are thus converted into respective photocurrents, whose amplitudes depend on the spectral composition and irradiance of the incident light. These typically low currents can subsequently be converted into amplified proportional voltage signals using dedicated electronic circuits, such as transimpedance amplifiers or other suitable types of current-to-voltage converters. An analog-to-digital converter (ADC) is eventually applied to convert the amplified voltage outputs into digital signals and, thus, prepare them for further digital processing. Alternatively, a light-to-frequency integrated circuit architecture can be used to directly convert the photocurrents into pulse trains or square waves, whose frequencies are proportional to the irradiance of the correspondingly filtered light [111], which facilitates multiplexing and increases immunity against noise on signal transmittance.  For a schematic overview, Figure 2 summarizes the different structural layers of a color sensor. The first layer comprises the optical elements, such as the housing and aperture, optical lenses, or diffusor plates, that are indented to guarantee a proper, conceivably cosine-corrected irradiation of the sensing area or to adjust the color sensor's angle of view according to the application requirements. The second layer is composed of the optical bandpass filters R * (λ), G * (λ), and B * (λ) that determine the sensor's spectral sensitivities R(λ), G(λ), and B(λ). The third layer represents the array of underlying photodiodes, i.e., the actual semiconductor layer, which is responsible for converting the filtered light into corresponding electrical currents. The fourth layer summarizes the electronic circuitry required to convert these photocurrents into proportional, usable signals. The fifth or ADC layer is optional depending on whether a standard current-to-voltage or an integrated circuit architecture is used. In the case of the former, the ADC layer is required to convert the amplified voltage outputs into digital signals. The sixth layer comprises the digital and computational processing of the digital raw sensor signals including the implementation of potential compensation and correction strategies (e.g., to correct for changes in temperature and humidity [112]), which eventually gives the final RGB readouts.

Determination of the Spectral Sensitivity Curves of an RGB Color Sensor
An accurate and precise measurement of the RGB color sensor's spectral sensitivity functions R(λ), G(λ), and B(λ) is necessary to guarantee an adequate sensor processing for the proper monitoring of the relevant lighting control parameters in mixed lighting conditions as sketched in the Introduction. The literature usually suggests to use a monochromator for this purpose [113][114][115][116][117][118]. An exemplary illustration of the experimental setup is given in Figure 3. As can be seen, a bright white light source of broad spectral composition, e.g., a xenon arc lamp or a Planckian emitter, provides the input to the monochromator. Within the monochromator, the light passing its entrance slit is projected onto an optical diffraction grating. Depending on its pre-selected rotation position, only light of a certain peak wavelength λ is thus projected onto the monochromator's exit slit. The resulting narrowband light output is eventually collected by an integrating sphere for spatial and angular homogenization of its corresponding light distribution [119]. At the same time, it holds both the (temperature-stabilized) color sensor that needs to be characterized and the spectroradiometer used to determine the spectral irradiance of the color stimulus registered by the color sensor. Based on this setup, the spectral sensitivity s k (λ) of the kth sensor channel can be determined from the sensor responses c k (φ(λ)) obtained for a set of selected color stimuli φ(λ) provided by the monochromator. According to Myland et al. [42], s k (λ) can be approximated as follows: where n k is the mean value of random noise observed for a no-light condition, i.e., when the monochromator output is closed and δ is a constant factor representing the sensor's gain and integration time settings. In the present work, an RGB color sensor prototype, which had been developed as part of the INNOSYS project [120] funded by the German Federal Ministry of Education and Research, served as the corresponding test device. Its spectral sensitivities were measured as described above using Equation (2) with a step size of ∆λ = 1 nm, where each of the color stimuli used for probing exhibited a full-width at half-maximum (FWHM) of approximately 2 nm. The corresponding laboratory setting is shown in Figure 4. The measurements were performed using a six-inch integrating sphere (Labsphere Inc., North Sutton, NH, USA) with a highly reflective white PTFE coating, a 300 W xenon arc lamp connected to an MSH 300 monochromator (Quantum Design GmbH, Darmstadt, Germany), and a Spectro 320D R5 spectroradiometer (Instrument Systems GmbH, Munich, Germany), which was directly attached to the north-pole port of the integrating sphere via a fiber-optic light guide. The main exit port of the integrating sphere at 90°/0°concomitantly served as the sensor mount to ensure a homogeneous light distribution in the color sensor's field of view. Due to random errors and systematic uncertainties in the measurement process of the spectral sensitivities, e.g., caused by measurement noise and the finite spectral bandwidth of the color stimuli, discrepancies between model-calculated virtual sensor responses and real sensor measurements must be expected. Thus, in order to improve system performance, the color sensor's measured sensitivity curves, which give a flawed spectral sensitivity (SS) model, should be corrected accordingly by introducing suitable wavelength-specific correction factors to minimize for each sensor channel the differences in output between the virtual and the real color sensor for a set of representative test light sources, whose SPDs are either known or determined spectroradiometrically. In the present case, a four-channel luminaire prototype [120] consisting of two narrowband monochromatic (red and blue) and two broadband phosphor-converted (cyan and mint-green) LEDs was used to generate 108 different white light test spectra with R a > 85 and CCTs in the range from 2700 K to 6500 K. The corresponding optimization pipeline is illustrated in Figure 5, where the differences between virtual and real channel responses calculated for the different test light spectra serve as feedback for running an interior-point optimization algorithm [121][122][123] to iteratively converge on an optimal set of corrected spectral sensitivities R (λ), G (λ), and B (λ) that yield the same channel outputs as the real color sensor.
For the RGB color sensor used in this work, the corresponding results are summarized in Figure 6 together with the CIE x(λ), y(λ), and z(λ) color matching functions (CMFs) representing the chromatic response sensitivities of the standardized CIE 2°observer [124]. As can be seen, the color sensor's sensitivity curves considerably deviate from the CMFs of the standard observer. Thus, in order to be able to perform colorimetric measurements, the sensor's RGB outputs in response to an arbitrary color stimulus need to be mapped onto its corresponding XYZ values as calculated from CIE colorimetry. As is shown in the next section, this mapping can be implemented in the form of a matrix transformation.

Colorimetric Mapping of RGB Sensor Readouts
Based on the measured spectral sensitivities of the specific RGB color sensor used in this work, a nonlinear matrix optimization procedure is proposed in order to minimize the mapping error when transforming from the sensor's RGB to XYZ tristimulus values. Figure 7 summarizes the optimization workflow. Starting from a training database of n different test light sources, CIE XYZ tristimulus values are calculated first by using: where S rel,i denotes the relative SPD of the ith test light source. Next, the corresponding CIE 1976 uniform chromaticity scale coordinates (u CIE,i , v CIE,i ) [125] are calculated by applying the following set of equations: (4) Figure 7. Optimization workflow used to find an optimal transformation matrix to map from the color sensor's RGB output to CIE XYZ tristimulus values.
A similar processing can be applied to the virtual channel responses of the color sensor. Thus, the sensor's readouts R i G i B i for each test light source i of the training set are given by: These readout values are then converted to estimated X SS,i Y SS,i Z SS,i tristimulus values by applying a matrix transformation of the form: From these tristimulus values, corresponding model chromaticity coordinates (u SS,i , v SS,i ) can be calculated as follows: The prediction error between model and CIE calculation is then given by which is used as the target function to be minimized as part of the optimization depicted in Figure 7. Again, the same interior-point optimization algorithm that was used to determine an optimal set of corrected sensor sensitivities was also applied here in order to find the matrix coefficients of Equation (6) that yield the smallest prediction errors ∆u v on the training database of different test light spectra. Instead of using a simple linear 3 × 3 matrix, the additional introduction of higher-order nonlinear polynomials in the applied matrix transformation may further reduce the prediction errors. Following the studies of Hong et al. [126] and Cheung et al. [127], various polynomials were tested as detailed in Table 1. After a suitable matrix transform has been found by means of optimization, a verification of the appropriateness of the transform for new light spectra that were not part of the training set is still pending. Thus, a second set of test light sources that differed from the initial training set was available for the purpose of validation. Basically, Equations (3)- (8) were again used to evaluate the final model prediction error for this new set of test light sources as obtained when applying the optimized matrix transform. A comparison of the performance for different matrix sizes and arrangements of nonlinear polynomials is given in Section 3.1.
Finally, it should be noted that the accuracy and predictive performance of this matrix optimization strategy strongly depends on the suitability of the training database with regard to the color sensor's intended application. Depending on whether the sensor is used for evaluating artificial or daylight light sources, different representative datasets should be considered for performing the optimization in order to derive case-specific matrices that exhibit superior performance compared to using "averaged" matrices only. Table 1. Overview of different (higher-) orders of (nonlinear) polynomials to be tested in the applied matrix transformation of Equation (6) according to Hong et al. [126] and Cheung et al. [127].

No.
Size Content

CIE Daylight Model and CCT Determination for a Daylight Spectral Reconstruction
As shown later in Section 3.1, the combination of the proposed processing for RGB color sensors and the computational model of Truong et al. given by Equation (1) yields a high accuracy in the determination of the CS for artificial light sources. In the case of dealing with daylight light sources, the accuracy can even further be improved by implementing an additional daylight spectral reconstruction step. Once the daylight spectrum is known, its corresponding CS value can be determined directly by applying Rea et al.'s original model as discussed in Section 2.1, which eliminates the need for additional approximations. Thus, the resulting errors in predicting CS for daylight light sources only depends on the applied daylight model (Section 2.3.1) and CCT determination algorithm (Section 2.3.1).

CIE Daylight Model
In this work, the CIE daylight model was applied as a well-accepted method of daylight spectral reconstruction widely used amongst practitioners and scientists. According to CIE [128], its CCT-dependent formalism is given by: where the auxiliary functions S 0 (λ), S 1 (λ), and S 2 (λ) are illustrated in Figure 8. Their function values are tabulated in the corresponding CIE publication [128]. The chromaticity factors M 1 and M 2 can be calculated from CCT as follows: For the CCT range of 5000 K ≤ CCT ≤ 7000 K: For the CCT range of CCT > 7000 K X D = −2.0064 · 10 9 CCT 3 + 1.9018 · 10 6 CCT 2 + 0.24748 · 10 3 CCT + 0.244063, so that the determination of S daylight (λ) can be traced back to an estimation of the CCT from the color sensor's RGB readouts. The corresponding algorithmic approach is discussed in the following section.

Determination of the CCT from Sensor Readouts
According to CIE definition [128], the indication of a CCT is only valid for white light sources whose chromaticity coordinates (u r , 2/3v r ) differ less than: from the chromaticities (u p , 2/3v p ) of a black body radiator of equivalent temperature. Note that the latter is determined by dropping a perpendicular from the respective light source's chromaticity coordinates to the Planckian locus as plotted in the CIE 1960 uniform chromaticity scale diagram [129,130]. Thus, the CCT of an arbitrary white light source can be calculated by finding the minimal distance between the light source's chromaticity coordinates and the Planckian locus by means of solving a nonlinear optimization problem and, therefore, finding the temperature corresponding to the Planckian radiator that causes the most similar color impression. In this work, the method proposed by Li et al. [131] was applied to solve the optimization problem. As it is based on Newton's method of optimization [132], it by definition only converges locally so that a good initial guess of the optimization's starting point is necessary to find the absolute minimum. This initial guess of CCT 0 is obtained by applying McCamy's CCT approximation method to the transformed color sensor readouts X SS Y SS Z SS . The corresponding equations read: where: give the chromaticity coordinates in the CIE 1931 chromaticity diagram [124]. The transformed sensor readouts are then converted to CIE 1960 uniform chromaticity scale coordinates (u SS , 2/3v SS ) by applying Equation (7). Using CCT 0 as the starting point of the optimization, applying the method of Li et al. yields the color temperature of a Planckian radiator whose chromaticities are closest to the chromaticity coordinates of the test light source under consideration. The derived color temperature eventually defines the light source's CCT.

Results
This section summarizes the results of the exemplary measurements that were performed at the Laboratory of Adaptive Lighting Systems and Visual Processing of the Technical University of Darmstadt in order to validate the proposed methodology discussed in the previous sections. Model performance was evaluated in terms of CS differences between the color sensor predictions and Rea et al.'s original model calculations for a selection of both artificial and daylight light sources.

CS Estimation for Artificial Light Sources
As discussed in Section 2.2.3, RGB sensor responses must be mapped to corresponding XYZ tristimulus values first to calculate the z coordinate required in Truong et al.'s CS approximation formula given by Equation (1). Under the assumption of sensor linearity, an additional linear mapping can be established between the sensor's green channel output and the likewise-required vertical illuminance E v .
The training database of measured light sources used for constructing these mappings is shown in Figure 9a for a single illuminance level of 750 lx. It comprises different technologies of artificial white light production, including halogen, xenon, compact, and fluorescent lamps, as well as phosphor-converted LEDs (pc-LEDs) and multi-channel LED luminaires. All spectra were measured using a calibrated CSS-45 spectroradiometer (Gigahertz Optik GmbH, Türkenfeld, Germany) with an optical bandwidth of 10 nm and measurement uncertainties in the x and y coordinates of ±0.002, in a CCT of ±4% (between 1700 and 17,000 K), and in illuminance E of ±4%. Based on the training data, the virtual sensor responses R i G i B i were then calculated for different illuminance levels, and the matrix optimization for mapping these sensor responses to X SS,i Y SS,i Z SS,i tristimulus values was initiated as discussed in Section 2.2.3. Table 2 summarizes the optimization results as calculated on the training data for different sizes of the applied transformation matrix. As can be seen, the overall best performance (= ∧ smallest average prediction error ∆u v ) was obtained for a simple linear 3 × 3 transform. Comparably good results can also be observed for matrices of sizes 3 × 19, 3 × 20, and 3 × 22. respectively. However, due to its simplicity, in particular with regard to a potential hardware implementation, the 3 × 3 approach appears to be most convenient to be applied in the present case. The corresponding optimized matrix elements, as well as the derived relationship between the illuminance E v and the sensor's green channel output G i are depicted in Table 3. In addition, Table 3 tabulates the color sensor's CS predictions for the light sources from the training dataset at an illuminance of 750 lx and compares them to the CS values obtained when applying Rea et al.'s original model directly to the measured data instead, which was assumed to represent the ground truth. As can be seen, maximal deviations in CS values of less than 0.028 were observed for this selection of test light sources, which is less than 10 % of the CS threshold of 0.3 for which positive effects on sleep quality, mood, and behavior are expected from the literature [43,109]. A sufficiently high measurement accuracy can thus be concluded.  The same holds true when applying the proposed CS estimation to a similar, yet different selection of artificial light sources that were not included in the training dataset used for the determination of the transformation matrix. Their SPDs constituting the validation data are illustrated in Figure 9b. The corresponding model prediction errors ∆u v and ∆CS were again calculated and are summarized in Table 4 for an illuminance of 750 lx. As can be seen, even smaller errors are observed for the validation than for the original training data, emphasizing that the discussed method including the optimized matrix transform to perform the colorimetric mapping of the sensor responses is most suitable for the determination of sufficiently accurate CS values over a broad variety of lighting technologies usually found in the indoor lighting context.
To ease implementation and to give a better overview of the proposed methodology for the CS estimation of artificial light sources from color sensor responses, Figure 10 depicts the necessary computational steps as a flowchart.  Figure 10. CS estimation from RGB sensor responses for artificial light sources. The 3 × 3 transformation matrix given in Table 3 is used to map RGB sensor responses to XYZ tristimulus values. The function for the calculation of E v,processed from G channel responses is also given in that table. Truong et al.'s CS approximation formula is given by Equation (1).  ) for a second set of artificial light sources not included in the training data. Again, the vertical illuminance was assumed to be 750 lx, and the CS 2018,origin measurement accuracy is ±8%. The annotation "(Meas. − Calc.)" in the "Compared parameters" section of the table serves as an indication that the accuracy estimate |∆CS 2018 |, as well as the colorimetric prediction error ∆u v for a given light source are determined by comparing the corresponding quantities derived from the performed radiometric measurements (i.e., "Meas.") to those calculated from the adequately processed sensor readouts (i.e., "Calc.") as described in this work.

CS Estimation for Daylight Light Sources
As described in Sections 2.3.1 and 2.3.2, the CS estimation for daylight spectra can be traced back to the determination of the CCT from the color sensor's readouts. After converting its RGB output to chromaticity space by applying a daylight-specific transformation matrix, the method of Li et al. can be used to determine the light source's CCT, which in turn is required to reconstruct its spectral composition by adopting Equations (9)- (14). Once the daylight spectrum is known, the corresponding CS value can directly be calculated without further approximations by making use of Rea et al.'s original model.
In order to derive the daylight-specific transformation matrix and to determine again the relationship between the sensor's green channel output and E v for daylight light sources, a dataset of spectral daylight measurements performed on the 19 August 2020 between 6:32 a.m. and 8:45 p.m. in Darmstadt, Hessen, Germany (GPS coordinates 49°51 20.772 N, 8°39 12.528 E) using again the CSS-45 spectroradiometer was available for training. The corresponding SPDs are depicted in Figure 11a.
As in the previous section, different matrices were tested for optimal model performance. The corresponding results are shown in Table 5 for a representative subset of the training data sampled at different measurement times. From these results, it can be confirmed that the use of a simple linear 3 × 3 matrix again yielded the smallest overall prediction errors. Comparably good results were observed for nonlinear matrices of sizes 3 × 7, 3 × 10, and 3 × 14, respectively. However, following the same argumentation as in Section 3.1, the 3 × 3 approach, due to its good model performance and simplicity, again appears to be the method of choice for dealing with daylight spectra.  Table 5. Remaining color differences after optimization for different sizes of the daylight-specific transformation matrix applied to the respective training set of measured daylight spectra. Note that only a small, but representative selection of different daylight spectra denoted by their sampling times is shown here. The reconstructed daylight spectra obtained from the color sensor responses by applying the daylight-specific 3 × 3 chromaticity transformation are thus depicted in Figure 11b. As can be seen from Figure 11c, which illustrates the spectral ratios between the original measurements from the training set and their reconstructed counterparts, the estimated and directly measured daylight spectra were in good agreement in the visually and physiologically most relevant range from about 440 nm to 630 nm. Larger deviations were only observed in the long-and short-wavelength regime. For λ ≤ 440 nm, the spectral ratio was mostly above unity, while for λ ≥ 630 nm, the spectral ratio was mostly below unity. As can be seen from Figure 11d, the resulting maximal color difference between measured and reconstructed daylight spectra was ∆u v max = 0.006 for lighting conditions captured in the early morning or late evening hours, i.e., when the corresponding CCTs were larger than 10,000 K, causing a bluish rather than a white color perception. However, for daytime mea-surements at smaller CCTs, the observed color differences were considerably reduced and mostly below the acceptance threshold of ∆u v accept = 0.003 as established by Bieske [133], which indicates that the proposed methodology of daylight estimation from RGB sensor responses performed sufficiently accurately in the majority of cases.

Sampling
From the reconstructed daylight spectra, CS values can now be determined by adopting Rea et al.'s original model definition. At this point, it should be noted that rather than estimating the daylight's spectral composition from the sensor responses, Truong et al.'s CS approximation method can be used in the same manner as discussed in Section 3.1 for artificial light sources. Hence, Table 6 summarizes for a representative subset of the training data sampled at different measurement times the corresponding results of both approaches and compares them to those obtained for Rea et al.'s original model when being directly applied to the measured daylight spectra without any further sensor processing, which as in the case of artificial light sources, was taken as the ground truth. As can be seen, excellent model performance in terms of predicting CS must be stated for the daylight reconstruction method, where maximal deviations were observed to be of the order of 0.002, which is about ten-times smaller than the maximal CS differences observed for Truong et al.'s approximation method. Thus, even though the latter gives somewhat smaller chromaticity differences ∆u v , the combination of RGB sensor output and CIE daylight model yields a significantly better performance in terms of predicting CS values from color sensor readouts with an almost perfect accuracy.
The reason for the somewhat larger chromaticity differences obtained by applying the spectral reconstruction method can be identified in the way S daylight (λ) is determined. As can be seen from Equations (9)- (14), the calculation of spectra defining the CIE daylight locus is solely based on the CCT parameter and, therefore, neglects chromaticity information. However, as the true chromaticities of the measured daylight spectra may differ from those modeled by the CIE daylight locus (even when the CCT is found to be the same), non-negligible chromaticity errors are likely to occur. Nonetheless, with regard to the main goal of the present work, i.e., the proper estimation of the circadian effectiveness of the prevalent lighting conditions from color sensor responses, the spectral reconstruction approach still appears to be the favored method because of its high accuracy in terms of predicting CS values for daylight light sources.
As for the case of artificial light sources, a validation of the proposed methodology should be performed on a second dataset of measured daylight conditions that were not included in the training data. Corresponding measurements were taken on 23 September 2020 between 7:27 a.m. and 19:15 p.m. at the same measurement location and by using the same measurement device as for the first round of spectral daylight acquisitions. The measured SPDs of the second round are thus visualized in Figure 12a, where the same daylight-specific 3 × 3 transformation matrix as optimized for the training data was used to convert the resulting color sensor responses to the chromaticity space for the CCT calculation and subsequent spectral modeling. The corresponding CIE model results are depicted in Figure 12b. Compared to the training data, similar findings can be reported on the spectral ratios between the original measurements of daylight spectra used for validation and their reconstructed estimations illustrated in Figure 12c. A good agreement (= ∧ spectral ratio close to unity) can again be confirmed in the wavelength range from 440 nm to 630 nm, while considerably larger deviations were obtained for shorter or longer wavelengths. As can be seen from Figure 12d, the maximal chromaticity difference ∆u v max was of the same order as observed for the training set, where again the greatest differences occurred in the early morning and late evening hours. However, in general, the resulting chromaticity differences for the validation data were well below the acceptance threshold defined by Bieske, which again emphasizes the suitability of the proposed approach. ) for a representative selection of daylight spectra from the respective training dataset. The measurement uncertainty for CS 2018,origin is of the order of ±8%. Additionally tabulated are the final 3 × 3 daylight-specific transformation matrix, as well as the corresponding functional relationship between the illuminance and the sensor's green channel output G i . Here, the annotation "(Meas. − Reconstr.)" indicates that the given accuracy estimates |∆CS 2018 | and colorimetric prediction errors ∆u v are determined by comparing the corresponding quantities derived from the performed radiometric measurements (i.e., "Meas.") and the application of Rea et al.'s model formalism to those obtained by processing the sensor readouts for the subsequent application of the CIE daylight reconstruction method (i.e., "Reconstr.") as proposed in this work. The annotation "(Meas. − Calc.)", on the other hand, again denotes the use of Truong et al.'s approximation method also for daylight spectra.  Finally, Table 7 summarizes the different model predictions when applying the daylight reconstruction approach in comparison to Truong et al.'s approximation method and the direct calculations performed on the set of measured validation data using Rea et al.'s original CS definition. As can be seen, similar results were obtained as reported for the set of training data: despite showing again slightly larger chromaticity deviations, the daylight reconstruction approach still outperformed Truong et al.'s approximation method in terms of CS prediction accuracy, which allowed for a proper estimation of the circadian effectiveness from color sensor responses even for "unknown" daylight conditions that were not included in the initial training database. To support reproducibility, the flowchart of Figure 13 eventually summarizes the proposed daylight reconstruction strategy and gives an overview of the required computational steps for a subsequent CS estimation.

Conclusions and Outlook
In this work, a novel sensor-based methodology was proposed to assess the circadian effectiveness of the prevalent lighting conditions caused by artificial and daylight light sources using simple and inexpensive RGB color sensors that can easily be integrated into modern lighting systems for proper monitoring and advanced lighting control. It was shown that the sensor readouts, after some suitable processing, can be used to estimate CS, a measure of circadian effectiveness, with high accuracy. For artificial light sources, the RGB sensor responses were mapped to CIE XYZ tristimulus values first by applying a suitable 3 transformation matrix. From these XYZ values, the corresponding chromaticity coordinate z can be calculated. Together with the lighting condition's illuminance E v , this provides the input for the application of Truong et al.'s approximation formula, which yields an estimate for the circadian effectiveness in terms of CS. Compared to Rea et al.'s original model description, only small model prediction errors (typically less than 0.028 ∆CS) were observed for a broad variety of artificial test light sources, emphasizing the suitability of the proposed approach with regard to predicting sufficiently accurate CS values from RGB sensor output for light sources usually found in the indoor lighting context.
For daylight light sources, on the other hand, an estimation of their spectral compositions from RGB sensor readouts was performed first by adopting the CIE daylight model. After converting the color sensor's RGB output to the CIE 1960 chromaticity space by applying a daylight-specific 3 × 3 matrix transform and subsequent linear transformation, i.e., from XYZ to (u , 2/3v ), a nonlinear optimization method was used to determine the daylights' CCTs, which are the main input in the CIE model to reconstruct their spectral compositions. With known illuminance E v , corresponding CS values could then be calculated without further approximations by applying Rea et al.'s original model to the estimated daylight spectra. Compared to Rea et al.'s model when applied directly to the measured light source data, the proposed daylight reconstruction method yielded excellent model performance with maximal prediction errors ∆CS max of less than 0.002 for both known (i.e., part of the training data) and unknown (i.e., not part of the training data) daylight conditions. In addition, it could be shown that for both test cases, the daylight reconstruction approach outperformed Truong et al.'s approximation method in terms of CS prediction accuracy, making the former the appropriate method of choice when dealing with daylight conditions. When comparing the results achieved for both artificial sources and daylight, it becomes clear that there might be still room for improvements regarding the application of the proposed methodology for the estimation of circadian effectiveness for artificial lighting conditions. Whereas for daylight, the reported model prediction errors were more or less of the same small order (see Tables 6 and 7), considerably larger discrepancies and greater errors were observed for their artificial counterparts (see Tables 3 and 4). Instead of using Truong et al.'s approximation method, it could therefore be expedient to also implement a spectral reconstruction strategy for artificial light sources so that Rea et al.'s original model can be applied without any further approximations. The first approaches for multi-channel sensors found in the literature using a multilayer perceptron seem to be quite promising for this purpose and report reconstructed SPD errors of less than 2% [134,135]. However, it remains questionable whether such a high accuracy can also be achieved with a simple RGB color sensor. Of course, the methodology proposed in this work could easily be adapted to be used in conjunction with a multi-channel sensor instead, which potentially would increase spectral reconstruction accuracy. However, additional experiments will be required to draw final conclusions.
For daylight conditions, on the other hand, the procedure described in this work so far dealt with outdoor measurements only. Nonetheless, with regard to the establishment of human-centered lighting control strategies, the accuracy of the proposed methodology must still be confirmed for daylight, which is measured indoors behind windows that are made of glass or other materials. As long as these transmissive materials are chiefly aselective in the visible regime [136][137][138] and, thus, only diminish the entering daylights' absolute levels of illuminance without changing their spectral composition, a similar accuracy as reported for the outdoor measurements can be expected to be observed when applying the proposed method to calculate CS for daylight conditions that are measured indoors. However, in the case that the spectral transmittance of the window material is strongly wavelength dependent, Truong et al.'s approximation method needs to be applied, which, as shown in this work, considerably reduces CS prediction accuracy (at least in its current form; see the previous paragraph). For both cases, though, dedicated experiments are required to confirm these expectations and eventually quantify the respective accuracies.
Regarding the issue of proper system integration and testing, ongoing research by our lab further addresses the lighting control problem in realistic application scenarios. For this purpose, a multi-channel IoT floor lamp prototype has recently been developed with contributions from some of the present authors [139] that allows for the implementation of additional color sensor devices to monitor the ambient lighting conditions as sketched in the Introduction. Thus, in order to account for potential changes in the ambient lighting conditions, color sensor feedback is intended to serve as suitable input for adaptively updating the lighting control parameters to achieve constant or pre-defined indoor lighting conditions that may for example keep the circadian effectiveness always at an optimal level. Corresponding field tests are currently under preparation, for which the current work provides the theoretical and methodological background. At the same time, it will guide others to develop similar sensor-based strategies for an advanced lighting control, which will help to drive the momentum towards the integration of human-centered lighting solutions into our daily lives.