Online Removal of Baseline Shift with a Polynomial Function for Hemodynamic Monitoring Using Near-Infrared Spectroscopy

Near-infrared spectroscopy (NIRS) has become widely accepted as a valuable tool for noninvasively monitoring hemodynamics for clinical and diagnostic purposes. Baseline shift has attracted great attention in the field, but there has been little quantitative study on baseline removal. Here, we aimed to study the baseline characteristics of an in-house-built portable medical NIRS device over a long time (>3.5 h). We found that the measured baselines all formed perfect polynomial functions on phantom tests mimicking human bodies, which were identified by recent NIRS studies. More importantly, our study shows that the fourth-order polynomial function acted to distinguish performance with stable and low-computation-burden fitting calibration (R-square >0.99 for all probes) among second- to sixth-order polynomials, evaluated by the parameters R-square, sum of squares due to error, and residual. This study provides a straightforward, efficient, and quantitatively evaluated solution for online baseline removal for hemodynamic monitoring using NIRS devices.

NIRS collects spectrum responses that include not only information from the sample itself, but also noise from other irrelevant sources, such as noise due to variations of electrical characteristics of the sample, the sample's particle size, light-scattering effects, or shot noise from the detector [11,12]. Thus, pretreatment to eliminate irrelevant noise is required [13]. Common pretreatment methods include mean centering, auto scaling, normalization, smoothing, standard normal variate transformation (SNV), detrending, multiplicative scatter correction (MSC), and orthogonal signal correction (OSC) [11,[13][14][15]. SNV was adopted to correct variations in density and particle size [16]. MSC and extended MSC are used to calibrate baseline shift arising from scattering effects in the spectrum measurements due to a change in wavelength [13]. The detrending method is always used to eliminate baseline shift in a diffuse reflection spectrum. For clinical applications, NIRS measurements are very sensitive to baseline shift, since the collected hemodynamic signal is weak. Since the measurements can be extensively affected by even a small baseline shift, the detrending method plays a vital role in removing baseline shift for clinical NIRS measurements.
Previous NIRS studies on using the detrending method to remove baseline shift primarily concentrated on the chemistry, food, and industrial fields [11]. It was demonstrated to be a feasible tool to improve the accuracy of component quantification, such as lactate concentration, poultry muscle defects, and prediction of petroleum product models [17][18][19][20]. However, few studies have looked at calibrating baseline shift for in vivo hemodynamic chromosphere measurements [21]. The Savitzky Golay (SG) algorithm has been used to smooth the data and eliminate baseline shift effects in industrial chemistry and brain-computer interface [13,15,22]. Other studies have reported the feasibility of the second-derivative approach to quantify baseline changes by fitting dynamic data to peak-wavelength response in the absorption spectrum [23]. Some recent NIRS studies on brain function initially reported using detrending methods, which were mainly focused on polynomial function fitting in data preprocessing [24,25]. However, none of the reasons or quantitative evaluations supporting the polynomial fitting calibration method were provided [24,25]. Taken together, baseline shift has attracted broad attention, especially functional NIRS in neuroscience [26], but no study so far has proposed an effective, easy-to-use, and quantitatively evaluated online calibration of baseline shift for in vivo hemodynamics monitoring with NIRS instruments.
Unlike spectrum measurements with varying wavelengths calibrated by SNV, MSC, or the extended MSC method to remove scattering variations, we measured optical density changes over time at three specific wavelengths that are not fit to be calibrated by the above methods. The reported baseline removal method used in hemodynamics-monitoring NIRS is actually mainly polynomial fitting. Thus, our study focused on polynomial fitting for baseline removal and we attempted to find the optimal order polynomial fitting for our baseline function.
Here, we collect and mathematically characterize baseline shift in a standard phantom test using mimicked human bodies. With such a characterized function, we were able to subtract baseline shift online and calibrate the hemodynamic measurements by NIRS accordingly. First, we used a noninvasive clinic-specific NIRS device developed in our lab to collect data with a solid phantom as the reference standard [27][28][29][30][31]. Then, the reference baseline was extracted and fitted with a series of mathematical functions provided in the MATLAB curve fitting toolbox. The highest level/value of fitting function was picked up and analyzed. Finally, we evaluated functions characterizing baselines with varied human blood hemodynamics experiments.

Detrending Method
The detrending method is usually used to eliminate the baseline shift of the diffuse reflectance of an SNV-processed spectrum. It has also been used to eliminate the effect of the offset generated by sensors or later quantification. This method can be used alone without SNV. It is a direct way to subtract an optimal fitting linearity, plane, or surface from an original spectrum so that the trends caused by sensors and samples can be calibrated [11,16].
The initial step of detrending is to trace the trend. Typically, the first-or second-order polynomial is adjusted to fit the trend [32]. Some studies have proposed that higher-order polynomials may help obtain a better level/value of fit, but with more risk of removing factual information [11]. For densely packed samples, the trend becomes curvilinear instead of linear. In this case, a second-order polynomial is mostly used as the following [16]: where p 1 , p 2 , and p 3 are the constant coefficients of the second-order polynomial.

Solid Phantom
Homogeneous phantoms are widely used for NIRS calibration [33]. We chose a solid phantom that is principally composed of polyvinyl alcohol gel. The gel provides absorptivity and scattering coefficients that are close to those of the human body. Enclosed by a latex shell, the gel is mixed with titanium dioxide microsphere particles (14 ± 7 µm diameter; refractive index n ≈ 1.58 at 780 nm) that can scatter [27]. The solid phantom is shaped into a 6-sided rectangle with the dimensions 100 mm × 85 mm × 44 mm. This phantom, perfect for mimicking the human body, is reproducible and stable for years, and is usually used to evaluate NIRS performance [27].

Data Acquisition System
The system consists of 3 parts: the software in a computer, 3 probes, and the functional module ( Figure 1a) [28]. The software was coded in C/C++ and LabWindows/CVI, with the functionalities of collecting data, translating to hemodynamic information, and displaying the data in real time. Each probe is composed of 1 LED source and 2 photo sensors, forming 2 channels in total (Figure 1b). At wavelengths of 735 nm, 805 nm, and 850 nm, we used the EPITEX L735.805.850-40C32P LED as the light source, which is a widely accepted choice for hemodynamics detection with NIRS [29,30]. OPT101 was chosen as the sensor, and the integrating preamplifier has good features of high optical signal conversion linearity, low output noise, and small dark current [30].
The functional module is the key part of the device. It includes a power circuit, control module, light source drive, data conversion module, display module, and transmission module [31]. The brief working process starts from the control module. Then the photo diodes receive attenuated emerging light. The data conversion module translates the light intensity data into hemodynamic data. Ultimately, the communication module sends the data to the software, where the waveforms are generated, displayed, and stored.

Solid Phantom
Homogeneous phantoms are widely used for NIRS calibration [33]. We chose a solid phantom that is principally composed of polyvinyl alcohol gel. The gel provides absorptivity and scattering coefficients that are close to those of the human body. Enclosed by a latex shell, the gel is mixed with titanium dioxide microsphere particles (14 ± 7 µ m diameter; refractive index n ≈ 1.58 at 780 nm) that can scatter [27]. The solid phantom is shaped into a 6-sided rectangle with the dimensions 100 mm × 85 mm × 44 mm. This phantom, perfect for mimicking the human body, is reproducible and stable for years, and is usually used to evaluate NIRS performance [27].

Data Acquisition System
The system consists of 3 parts: the software in a computer, 3 probes, and the functional module ( Figure 1a) [28]. The software was coded in C/C++ and LabWindows/CVI, with the functionalities of collecting data, translating to hemodynamic information, and displaying the data in real time. Each probe is composed of 1 LED source and 2 photo sensors, forming 2 channels in total (Figure 1b). At wavelengths of 735 nm, 805 nm, and 850 nm, we used the EPITEX L735.805.850-40C32P LED as the light source, which is a widely accepted choice for hemodynamics detection with NIRS [29,30]. OPT101 was chosen as the sensor, and the integrating preamplifier has good features of high optical signal conversion linearity, low output noise, and small dark current [30].
The functional module is the key part of the device. It includes a power circuit, control module, light source drive, data conversion module, display module, and transmission module [31]. The brief working process starts from the control module. Then the photo diodes receive attenuated emerging light. The data conversion module translates the light intensity data into hemodynamic data. Ultimately, the communication module sends the data to the software, where the waveforms are generated, displayed, and stored.

Baseline Extraction and Removal
A soft probe-shaped black sticker is attached to the probe to ensure that the probe is tightly placed together with the sample and the background light is kept away. Probe 1 was placed on the surface of the solid phantom (Figure 1c). Then we placed Probe 1 and the phantom in a dark box. The software in the computer started to collect light intensity data for >3.5 h (Figure 1d). We performed this experiment with Probe 2 and Probe 3 in turn [28]. All the collected data from the 3 probes were then imported into MATLAB to perform function fitting. We used the R-square value and the sum of squares due to error of prediction (SSE) value to evaluate how well it fit by using the fitting function, and to find the optimal function [34]. SSE is the sum of squares due to error given by Equation (2), which represents the extent the fitting function gets to.
y i is the response value, whileŷ i is the corresponding predicted value. w i is the weight to minimize the error estimate as a scale factor. A value of SSE closer to 0 indicates a better fit. The R-square value represents the determination coefficient given by Equation (5), which refers to the level of fitting effect. R-square is defined as the ratio of the sum of squares of the regression (SSR) and the total sum of squares (SST). SSR is defined as SST is the sum of squares about the mean, given as where SST = SSR + SSE. Given these definitions, A value of R-square closer to 1 indicates a better fit.

Experiment on Removal Effect
To evaluate calibration effectiveness by the optimal fitting function, a blood model experiment was performed and baseline removal was carried out online. This study was approved by the ethics committee (approval no. XHECD-2014-005). Sixty healthy volunteers (32 men and 28 women) from the university community were recruited by the affiliated hospital of our university, Sichuan Provincial People's Hospital. The average age was 22.9 years for both genders. No volunteer had taken any drugs before researchers drew 5 mL blood samples. All volunteers provided written consent to participate in this study. One woman and 2 men were excluded because of blood-related diseases that could affect the results. The details of the experimental setup and protocol have been fully described in reference 32. Briefly, we structured a cylindrical phantom container into which human blood was injected. Then we injected yeast to deoxidize and alternately bubble oxygen gas into the container and recorded the hemodynamic variations with our NIRS device. The hemodynamic variation data, based on quantifications with different extinction coefficients, were collected to work with function fitting [35].

Fourth-Order Polynomial Function
Data collected from three probes were extracted for fitting with MATLAB. We tried all functions offered in the curve fitting toolbox, and found the polynomial function had the best match with the highest level of fit by the following equation: f(x) = p 1 x n + p 2 x n−1 + p 3 x n−2 + · · · + p n−1 x 2 + p n x + p n+1 (6) where p 1 , p 2 , p 3 , · · · , p n−1 , p n , and p n+1 are the constant coefficients of the n order polynomial. This finding agreed with prior studies [13,16]. We then used polynomial functions from the second order to the fifth order. We found that the fourth-and fifth-order polynomial functions had good fitting effect. Both were close and had no significant overfitting. Since the fifth-order polynomial fitting required more computation burden than the fourth-order polynomial fitting, and the fourth-order polynomial fitting had almost the same perfect fit, we decided to use fourth-order polynomial fitting for online calibration of NIRS measurements, which had not been employed in previous studies.

Fourth-Order Polynomial Function
Data collected from three probes were extracted for fitting with MATLAB. We tried all functions offered in the curve fitting toolbox, and found the polynomial function had the best match with the highest level of fit by the following equation: where 1 , 2 , 3 , ⋯, −1 , , and +1 are the constant coefficients of the n order polynomial. This finding agreed with prior studies [13,16]. We then used polynomial functions from the second order to the fifth order. We found that the fourth-and fifth-order polynomial functions had good fitting effect. Both were close and had no significant overfitting. Since the fifth-order polynomial fitting required more computation burden than the fourth-order polynomial fitting, and the fourth-order polynomial fitting had almost the same perfect fit, we decided to use fourth-order polynomial fitting for online calibration of NIRS measurements, which had not been employed in previous studies. A comparison of the level of fitting among the fourth-order polynomial, the fifth-order polynomial, and the widely used second-order polynomial is shown in Figure 2. The typical probe, Probe 3 Channel 1, was taken as an example. The left axes (Figure 2a, d, g) are spectra that used the A comparison of the level of fitting among the fourth-order polynomial, the fifth-order polynomial, and the widely used second-order polynomial is shown in Figure 2. The typical probe, Probe 3 Channel 1, was taken as an example. The left axes (Figure 2a,d,g) are spectra that used the second-order polynomial, whereas the middle axes (Figure 2b,e,h) used the fourth-order polynomial and the right axes (Figure 2c,f,i) are spectra that used the fifth-order. Each pair of graphs consists of the original hemodynamic parameters and fit at the top, and the residuals at the bottom. Blue dots represent original data and red dots show the fit in the top graph. Black dots represent the residuals between the original data and fit. Apparently, the fit in the middle and on the right is closer to the original hemodynamic parameters than the fit on the left, and this demonstrates that the fourth-order and fifth-order polynomial functions fit better. Clearly, the residuals in the middle and right graphs (Figure 2b,c,e,f,h,i) are closer to zero and more stable than those from the second-order polynomial (Figure 2a,d,g). From the perspective of fitting a curve, the fourth-order and fifth-order polynomials undoubtedly provide better fit. Table 1 shows a quantification of the level of fit among the second-, fourth-, and fifth-order polynomial functions for all three probes, all channels, and all three hemodynamic parameters (HbO 2 , Hb, tHb). Typically, an R-square value >0.900 is a good value.

Evaluating the Level of Fit
Regarding the evaluation data, all R-square values from the fourth-and fifth-order polynomials are >0.990, which is significantly higher than those from the second-order polynomial, even though they also reached a high level >0.900. The SSE values and R-square values of the fourth-and fifth-order polynomials for every hemodynamic parameter, every channel, and every probe produce much better fitting effects than the corresponding values of the second-order polynomial.
No significant overfitting is shown in the fourth-and fifth-order polynomial fit. Of note, the SEE, R-square, and residual curves of fifth-order polynomial fit are quite close to those of the fourth-order polynomial fit, suggesting that the fourth-order polynomial fit is sufficient. Taking into account that the computational burden of fifth-order polynomial fitting is higher than fourth-order polynomial fitting, we decided to use the fourth-order polynomial fitting function for online calibration of the NIRS-based medical device.

Verification of the Calibration
To verify the feasibility of fourth-order polynomial function for fitting, we performed an experiment with the function embedded system using human blood samples [35]. Data are shown with and without calibration. As shown in Figure 3, the left axes are data of HbO 2 (oxygenated hemoglobin) and Hb (deoxygenated hemoglobin) quantified with three extinction coefficient datasets without calibration, whereas the right axes are those with calibration. The fourth-order polynomial was found to effectively remove baseline shift, successfully suppressing the primary curve downwards.
Sensors 2018, 18, x FOR PEER REVIEW 7 of 10 hemoglobin) and Hb (deoxygenated hemoglobin) quantified with three extinction coefficient datasets without calibration, whereas the right axes are those with calibration. The fourth-order polynomial was found to effectively remove baseline shift, successfully suppressing the primary curve downwards. Figure 3. Hemodynamic parameters measured without calibration and with calibration for a typical subject as an example, using fourth-order polynomial detrending.

Conclusions and Discussion
The aim of this study was to explore how an optimal polynomial function would characterize baseline trend so that we could directly and effectively remove the baseline trend by subtracting the baseline-shift function online. A fourth-order polynomial fitting function is recommended, based on R-square, SSE, and residual evaluations among second-to sixty-order polynomial fittings, which showed strong potential in online baseline removal for clinical and health care NIRS instruments. This indicates that tissue HbO2, Hb, and tHb concentrations can be monitored in a reliable way with effective baseline removal.
For the hemodynamic parameters of NIRS, we found that the fourth-order polynomial function achieved a higher level of fit than the second-order polynomial function, which was widely used in prior studies for chemical particle or food testing with NIRS instruments [11,13,16]. All R-square values of the fourth-order polynomial function were >0.990, which was higher than those of the second-order polynomial functions (>0.900). In addition, the numerically smaller SSE values supported better fit with the fourth-order polynomial compared to the second-order polynomial. Additionally, the matches between the measured data and fitted curves and residual curves validated the perfect characterization of the fourth-order polynomial function.

Conclusions and Discussion
The aim of this study was to explore how an optimal polynomial function would characterize baseline trend so that we could directly and effectively remove the baseline trend by subtracting the baseline-shift function online. A fourth-order polynomial fitting function is recommended, based on R-square, SSE, and residual evaluations among second-to sixty-order polynomial fittings, which showed strong potential in online baseline removal for clinical and health care NIRS instruments. This indicates that tissue HbO 2 , Hb, and tHb concentrations can be monitored in a reliable way with effective baseline removal.
For the hemodynamic parameters of NIRS, we found that the fourth-order polynomial function achieved a higher level of fit than the second-order polynomial function, which was widely used in prior studies for chemical particle or food testing with NIRS instruments [11,13,16]. All R-square values of the fourth-order polynomial function were >0.990, which was higher than those of the second-order polynomial functions (>0.900). In addition, the numerically smaller SSE values supported better fit with the fourth-order polynomial compared to the second-order polynomial. Additionally, the matches between the measured data and fitted curves and residual curves validated the perfect characterization of the fourth-order polynomial function.
Unequivocally, it is more than coincidence that all three hemodynamic concentrations attained the same improved level of fit via the experiment on removal effect. We integrated the recommended function into the software of the medical NIRS instrument for stable online calibration in a series of successful clinical applications, including shock patient monitoring [28], blood thrombosis monitoring [36], and other clinical studies [29,31]. The calibrating algorithm online for every hemodynamic parameter will improve the accuracy of medical NIRS instruments.
Of note, the cause of the baseline shift may not yet be clear. Originally, we guessed that baseline shift might be caused by thermal changes in LED sources and sensors. We performed a temperature test to verify this guess, using a thermometer to measure the temperature variations of both devices every 10 min for 3.5 h. Figure 4 demonstrates that the temperature change is relatively slight and does not form a shaped curve comparable to that of NIRS measurement baselines. Thus, the thermal change may not be the main cause of NIRS baseline shift. Baseline shift may depend on the algorithm of the control IC, the structure of the peripheral circuits, and the sensors. Improvement and optimization of the hardware, such as the sensors or circuits, could possibly be beneficial for reducing baseline shift. Unequivocally, it is more than coincidence that all three hemodynamic concentrations attained the same improved level of fit via the experiment on removal effect. We integrated the recommended function into the software of the medical NIRS instrument for stable online calibration in a series of successful clinical applications, including shock patient monitoring [28], blood thrombosis monitoring [36], and other clinical studies [29,31]. The calibrating algorithm online for every hemodynamic parameter will improve the accuracy of medical NIRS instruments.
Of note, the cause of the baseline shift may not yet be clear. Originally, we guessed that baseline shift might be caused by thermal changes in LED sources and sensors. We performed a temperature test to verify this guess, using a thermometer to measure the temperature variations of both devices every 10 min for 3.5 h. Figure 4 demonstrates that the temperature change is relatively slight and does not form a shaped curve comparable to that of NIRS measurement baselines. Thus, the thermal change may not be the main cause of NIRS baseline shift. Baseline shift may depend on the algorithm of the control IC, the structure of the peripheral circuits, and the sensors. Improvement and optimization of the hardware, such as the sensors or circuits, could possibly be beneficial for reducing baseline shift. In summary, we have characterized the baseline of hemodynamic monitoring using NIRS by fitting it with mathematical functions and determined the optimal one by full quantitative comparison in terms of the level of fitting R-square and SSE, and residual curves. We found that the fourth-order polynomial function acted the best, characterizing baselines with high reliability, effectiveness, and stability. Furthermore, calibration with this fourth-order polynomial function was successfully verified by a human blood-based varied hemodynamics experiment. The calibration approach we propose is useful for NIRS applications in clinics and health care, with merits in effectiveness, stability, speed, and convenience. the data, with the help of Yan Li and Ke Zhao. Yan Li assisted with the experiment design, the data processing, and revision.

Conflicts of Interest:
The authors declare no conflict of interest.