Case Study on the Fitting Method of Typical Objects

: This study proposes different ﬁtting methods for different types of targets in the 400–900 nm wavelength range, based on convex optimization algorithms, to achieve the effect of high-precision spectral reconstruction for small space-borne spectrometers. This article ﬁrst expounds on the mathematical model in the imaging process of the small spectrometer and discretizes it into an AX=B matrix equation. Second, the design basis of the ﬁlter transmittance curve is explained. Furthermore, a convex optimization algorithm is used, based on 50 ﬁlters, and appropriate constraints are added to solve the target spectrum. First, in terms of spectrum ﬁtting, six different ground object spectra are selected, and Gaussian ﬁtting, polynomial ﬁtting, and Fourier ﬁtting are used to ﬁt the original data and analyze the best ﬁt of each target spectrum. Then the transmittance curve of the ﬁlter is equally divided, and the corresponding AX=B discrete equation set is obtained for the speciﬁc object target, and a random error of 1% is applied to the equation set to obtain the discrete spectral value. The ﬁtting is performed for each case to determine the best ﬁtting method with errors. Subsequently, the transmittance curve of the ﬁlter with the detector characteristics is equally divided, and the corresponding AX=B discrete equation set is obtained for the speciﬁc object target. A random error of 1% is applied to the equation set to obtain the error. After the discrete spectral values are obtained, the ﬁtting is performed again, and the best ﬁtting method is determined. In order to evaluate the ﬁtting accuracy of the original spectral data and the reconstruction accuracy of the calculated discrete spectrum, the three evaluation indicators MSE, ARE, and RE are used for evaluation. To measure the stability and accuracy of the spectral reconstruction of the ﬁtting method more accurately, it is necessary to perform 500 cycles of calculations to determine the corresponding MSE value and further analyze the inﬂuence of the ﬁtting method on the reconstruction accuracy. The results show that different ﬁtting methods should be adopted for different ground targets under the error conditions. The three indicators, MSE, ARE, and RE, have reached high accuracy and strong stability. The effect of high-precision reconstruction of the target spectrum is achieved. This article provides new ideas for related scholars engaged in hyperspectral reconstruction work and promotes the development of hyperspectral technology.


Introduction
In recent years, hyperspectral technology has been widely used in agriculture [1][2][3][4], resource exploration [5][6][7][8], oceanic studies [9], and environmental research [10]. Spectrometers are gradually becoming intelligent, miniaturized, and lightweight. At present, space-borne and airborne spectrometers must use miniaturized and high-precision spectrometers due to their volume limitations. At present, the main difficulties faced by miniature spectrometers are concentrated on two points. One is the influence of the number of filters in front of the detector on the accuracy of spectral information. The higher the number of filters, the higher the accuracy of the solution [11]. The second is to fit the discrete spectral information. At present, few scholars have studied the spectral fitting method based on the filter. Thus, the focus of this article is to analyze the influence of the fitting method on spectral reconstruction.
The number of filters used in previous related research projects is about 200, and the spectral range is 400-900 nm. Therefore, the fitting method has little influence on the effect of spectral reconstruction. However, when the number of filters is small, the amount of data is sparse, and the fitting method has a greater impact on spectral reconstruction. Therefore, the fitting method is essential for a small spectrometer to achieve high-precision measurement. High-precision spectral deconstruction algorithms are the basis of high-precision spectral reconstruction. Many algorithms for spectral decomposition have recently been proposed.
Chang [12] analyzed the working process of the spectrometer and proposed a mathematical model for spectral reconstruction. Based on 200 filters, regularization and generalized cross-validation (GCV) were used to achieve high-precision spectral reconstruction. Finally, combined with non-uniform correction, the spectrum reconstruction accuracy is further improved, and the minimum value of the spectrum accuracy evaluation index ARE reaches 0.0248. In 2015, Bao [13] made innovations on the filter material, using quantum dot materials as 50 filters for spectral reconstruction, and achieved a better reconstruction effect.
In 2018, Zhang [14] proposed a reconstruction algorithm based on sparse optimization and dictionary learning based on 192 filters. The results show that the relative reconstruction error (RE) reaches 5.92%, achieving a good spectral reconstruction effect. In 2021, Zhao [15] used compressed sensing in the spectral reconstruction algorithm to reconstruct spectral reflectance. The experimental results prove that compressed sensing uses low-sampling data to achieve the effect of full sampling, which improves the accuracy of spectral reflectance reconstruction. The previous related research was based on hundreds of filters to reconstruct the target spectrum. Although a high reconstruction accuracy was achieved, hundreds of filters could not reconstruct the target spectrum due to the satellite spectrometer detector's volume limitation. This article uses 50 filters for analysis, which effectively reduces the amount of data and should prove vital for developing space-borne spectrometers.

Spectral Reconstruction Process
The reconstruction process is shown in Figure 1. The target spectrum first passes through the filter at the front of the detector. The energy on each filter can be obtained after the detector is modulated. The whole process can be considered the integration of the target spectrum, the transmittance of the filter, and the quantum efficiency of the detector within the wavelength range.
The integral expression is shown in Formula (1) [16,17]. T i (λ) is the transmittance function, f (λ) is the detector quantum efficiency, X(λ) is the target spectral function, λ 1 and λ 2 are the integral wavelength ranges, and n is the number of filters.
The transmittance curve of the filter with detector characteristics in Figure 2 is the curve obtained by integrating the transmittance curve of the filter and the quantum efficiency curve of the detector in the range of λ 1 and λ 2 , which is A(λ) = T i (λ) f (λ). In this paper,λ 1 and λ 2 are, respectively, 400 nm and 900 nm. By dividing the wavelength range of 400-900 nm equally, finding the area of each band, and then doing the same division on the target spectrum curve, it yields the average value of energy in each band. After discretization, the area of each band in each filter is multiplied by the mean value in the corresponding band of the target spectrum to obtain the energy B of the target on each filter. In order to ensure the uniqueness of the solution of the discrete equation, matrix A is a square matrix of n × n (that is, the number of filters is equal to the dimension of matrix A).
The transmittance curve of the filter with detector characteristics in Figure 2 is the curve obtained by integrating the transmittance curve of the filter and the quantum efficiency curve of the detector in the range of In this paper, 1  and 2  are, respectively, 400 nm and 900 nm. By dividing the wavelength range of 400-900 nm equally, finding the area of each band, and then doing the same division on the target spectrum curve, it yields the average value of energy in each band. After discretization, the area of each band in each filter is multiplied by the mean value in the corresponding band of the target spectrum to obtain the energy B of the target on each filter. In order to ensure the uniqueness of the solution of the discrete equation, matrix A is a square matrix of nn  (that is, the number of filters is equal to the dimension of matrix A ).
However, the spectrometer's accuracy will be affected by a variety of error sources. The main error sources are the stray light error [19][20][21] and the detector non-uniformity error [22][23][24]. These errors make the equation AX = B unsuitable and add difficulty obtaining a solution for the equation. The discretized integral Equation (1) becomes Equation (2) [18].
Expanding Equation ( However, the spectrometer's accuracy will be affected by a variety of error sources. The main error sources are the stray light error [19][20][21] and the detector non-uniformity error [22][23][24]. These errors make the equation AX=B unsuitable and add difficulty obtaining a solution for the equation.
In an ideal situation, the number of discrete wavelengths of the target spectrum should be equal to the number of filters. The greater the number of discrete wavelengths, the higher the spectral resolution.
To calculate the spectral information more accurately, we first divide the spectral curve of the filter into 25 evenly equal regions and calculate the average light intensity in the range of every 20 nm Y j (j = 1, 2, · · · · · · , 25). The spectral curve of the filter is divided into 50 equal parts (one part for every 10 nm), and the average light intensity X i (i = 1, 2, · · · · · · , 50) is calculated in the range of every 10 nm.
The theoretical expressions of Y j (j = 1, 2, · · · · · · , 25) and X i (i = 1, 2, · · · · · · , 50) are as shown in Equation (4). The calculation of Y j and Y j is solved by a convex optimization algorithm, and the specific expressions are shown in Equations (5) and (6): In Equations (5) and (6), X i (i = 1, 3, 5, · · · · · · , 50) and Y j (j = 1, 2, · · · · · · , 25) are energy constraints. Y j is the estimated value calculated by Equation (5) When Equation (1) is not discretized, calculate the average energy mean of the target spectrum in the range of 400-900 nm. T and T are used as constraints to solve the overall mean value of the discrete spectrum. The calculated Y j (j = 1, 2, · · · · · · , 25) value is the average value of energy in every 20 nm wavelength range, and the calculated X i (i = 1, 2, · · · · · · , 50) value is the average value of energy in every 10 nm wavelength range.
The Q in Equation (6) is the constraint between X and Y. After obtaining the discrete values, they are considered the energy value of the center wavelength in the corresponding band. The data are then fitted to obtain the target reconstructed spectrum curve.
The choice of the filter is critical as it directly affects the accuracy of Equation (3). According to the matrix analysis, the condition number cond(A) of the matrix A composed of the filter is as small as possible to ensure the matrix equation is more robust [25]. In short, when designing the transmittance curve of the filter, the shape of the curve should have a low similarity. Based on this principle, the filter is designed and simulated.

Fitting the Original Spectra of Ground Objects
Since spacecraft functions are different, the observation targets are also different, but the spectral curve shapes of the same types of ground targets are similar. Therefore, the monochromatic light source and five typical objects are selected for spectral reconstruction. First, the target spectrum is normalized, and then the commonly used Gaussian, polynomial, and Fourier methods are selected for error-free fitting. The fitting results are shown in                There are different indicators for evaluating the effect of spectral reconstruction. Most previous studies have adopted MSE, ARE, and RE. The expressions of MSE, ARE, and RE are shown in (6)- (8). Equations (6) and (7) have similar meanings, but for better comparison with previous research, this paper uses the three indicators of MSE, RE, and ARE to evaluate the reconstructed spectrum. The smaller the three indicators are, the better the spectral reconstruction effect will be.   There are different indicators for evaluating the effect of spectral reconstruction. Most previous studies have adopted MSE, ARE, and RE. The expressions of MSE, ARE, and RE are shown in (6)- (8). Equations (6) and (7) have similar meanings, but for better comparison with previous research, this paper uses the three indicators of MSE, RE, and ARE to evaluate the reconstructed spectrum. The smaller the three indicators are, the better the spectral reconstruction effect will be.   There are different indicators for evaluating the effect of spectral reconstruction. Most previous studies have adopted MSE, ARE, and RE. The expressions of MSE, ARE, and RE are shown in (6)- (8). Equations (6) and (7) have similar meanings, but for better comparison with previous research, this paper uses the three indicators of MSE, RE, and ARE to evaluate the reconstructed spectrum. The smaller the three indicators are, the better the spectral reconstruction effect will be. There are different indicators for evaluating the effect of spectral reconstruction. Most previous studies have adopted MSE, ARE, and RE. The expressions of MSE, ARE, and RE are shown in (6)- (8). Equations (6) and (7) have similar meanings, but for better comparison with previous research, this paper uses the three indicators of MSE, RE, and ARE to evaluate the reconstructed spectrum. The smaller the three indicators are, the better the spectral reconstruction effect will be.
In the above equations,y i is the original target spectrum, ∧ y is the target spectrum after fitting, and y is the average value of the original spectrum. The specific evaluation indicators are shown in Tables 1-3.  3 show that copper metal and mica schist use Gaussian fitting to achieve the best results. Grass green plants, Jasper Ridge gravel, and asphalt have the best polynomial fitting effect. Loam uses Fourier fitting the best. The evaluation indicators when the best fit method is adopted for the six targets are shown in Table 4.

Spectral Fitting of Discrete Objects with Errors
After determining the best fitting method of the original target spectrum, 50 filters are used to establish the AX=B equation set, and a 1% random error is applied. The convex optimization algorithm is used to calculate 50 discrete spectra, and fitting is performed. For the case of applied error, the best fitting method of each discrete target spectrum was determined. The error between the MSE value of each 10 nm wavelength and the standard value was calculated by comparing the changes of the fitting methods under the two conditions. The results are shown in Figures 9-20.

Spectral Fitting of Discrete Objects with Errors
After determining the best fitting method of the original target spectrum, 50 filters are used to establish the AX = B equation set, and a 1% random error is applied. The convex optimization algorithm is used to calculate 50 discrete spectra, and fitting is performed. For the case of applied error, the best fitting method of each discrete target spectrum was determined. The error between the MSE value of each 10 nm wavelength and the standard value was calculated by comparing the changes of the fitting methods under the two conditions. The results are shown in Figures 9-20.

Spectral Fitting of Discrete Objects with Errors
After determining the best fitting method of the original target spectrum, 50 filters are used to establish the AX = B equation set, and a 1% random error is applied. The convex optimization algorithm is used to calculate 50 discrete spectra, and fitting is performed. For the case of applied error, the best fitting method of each discrete target spectrum was determined. The error between the MSE value of each 10 nm wavelength and the standard value was calculated by comparing the changes of the fitting methods under the two conditions. The results are shown in Figures 9-20.    Figure 11. Fifty discrete value fitting images of mica schist. Figure 11. Fifty discrete value fitting images of mica schist.                         The target spectrum curve fitting evaluation index is shown in Tables 5-7.  Tables 5-7 show that when there is an error, the discrete value calculated by AX=B is fitted. Mica schist, grass, Jasper Ridge gravel, and asphalt have the best fitting results by polynomial fitting, while copper metal and loam have the best fitting precision by Fourier fitting. The evaluation indicators are shown in Table 8.   7 show that the target polynomial fitting of mica schist, grass, loam, asphalt, and Jasper Ridge gravel has little difference with Fourier fitting, and the indicators are relatively close.
To further verify the correctness and stability of the above-mentioned feature target evidence fitting method, 500 calculations and fittings are performed, and the MSE value of each target under different fitting methods is calculated. The MSE distribution is shown in Figures 21-38.      7 show that the target polynomial fitting of mica schist, grass, loam, asphalt, and Jasper Ridge gravel has little difference with Fourier fitting, and the indicators are relatively close.
To further verify the correctness and stability of the above-mentioned feature target evidence fitting method, 500 calculations and fittings are performed, and the MSE value of each target under different fitting methods is calculated. The MSE distribution is shown in Figures 21-38.      7 show that the target polynomial fitting of mica schist, grass, loam, asphalt, and Jasper Ridge gravel has little difference with Fourier fitting, and the indicators are relatively close.
To further verify the correctness and stability of the above-mentioned feature target evidence fitting method, 500 calculations and fittings are performed, and the MSE value of each target under different fitting methods is calculated. The MSE distribution is shown in Figures 21-38.                                                              After 500 calculations under the condition of 1% random error, the following results can be obtained. Copper metal, mica schist, loam, and Jasper Ridge gravel achieve polynomial fitting accuracy with the highest MSE average values of 0.01, 1 × 10 −3 , 2 × 10 −3 , 4 × 10 −3 , respectively. The fitting accuracy of Fourier and polynomials of grasses and other green plants is about 10e-3, and the effect of Fourier fitting is better. In particular, it is pointed out that although Gaussian fitting has higher accuracy, the MSE value is prone to jump, so Gaussian fitting is not suitable for the above-mentioned object targets.

Conclusions
In this study, the working principle and mathematical model of the spectrometer are elaborated. Six typical targets are selected based on fifty filters. The convex optimization algorithm is used to solve the Equations (2). Unlike the previous research, the number of filters used in this paper is fewer, and the spectral data are sparser, so the fitting method is critical. Based on the 50 transmittance curves given in this paper, the best fitting method of the original spectrum and the 50 discrete spectrums obtained by solving Equation (2) re analyzed. In terms of spectral reconstruction evaluation, the three indicators ARE, RE, and MSE are used for evaluation, further improving the accuracy of the spectral reconstruction evaluation. The convex optimization solution method, fitting method, and spectrum evaluation index proposed in this study are unique and promising to advance the field of spectrum reconstruction and are also conducive to the miniaturization of the spectrometer.
The transmittance curve of 50 filters in the wavelength range of 400-900 nm is shown in Figure 39 below.  After 500 calculations under the condition of 1% random error, the following results can be obtained. Copper metal, mica schist, loam, and Jasper Ridge gravel achieve polynomial fitting accuracy with the highest MSE average values of 0.01, 1 × 10 −3 , 2 × 10 −3 , 4 × 10 −3 , respectively. The fitting accuracy of Fourier and polynomials of grasses and other green plants is about 10e-3, and the effect of Fourier fitting is better. In particular, it is pointed out that although Gaussian fitting has higher accuracy, the MSE value is prone to jump, so Gaussian fitting is not suitable for the above-mentioned object targets.

Conclusions
In this study, the working principle and mathematical model of the spectrometer are elaborated. Six typical targets are selected based on fifty filters. The convex optimization algorithm is used to solve the Equations (2). Unlike the previous research, the number of filters used in this paper is fewer, and the spectral data are sparser, so the fitting method is critical. Based on the 50 transmittance curves given in this paper, the best fitting method of the original spectrum and the 50 discrete spectrums obtained by solving Equation (2) re analyzed. In terms of spectral reconstruction evaluation, the three indicators ARE, RE, and MSE are used for evaluation, further improving the accuracy of the spectral reconstruction evaluation. The convex optimization solution method, fitting method, and spectrum evaluation index proposed in this study are unique and promising to advance the field of spectrum reconstruction and are also conducive to the miniaturization of the spectrometer.
The transmittance curve of 50 filters in the wavelength range of 400-900 nm is shown in Figure 39 below. After 500 calculations under the condition of 1% random error, the following results can be obtained. Copper metal, mica schist, loam, and Jasper Ridge gravel achieve polynomial fitting accuracy with the highest MSE average values of 0.01, 1 × 10 −3 , 2 × 10 −3 , 4 × 10 −3 , respectively. The fitting accuracy of Fourier and polynomials of grasses and other green plants is about 10e-3, and the effect of Fourier fitting is better. In particular, it is pointed out that although Gaussian fitting has higher accuracy, the MSE value is prone to jump, so Gaussian fitting is not suitable for the above-mentioned object targets.

Conclusions
In this study, the working principle and mathematical model of the spectrometer are elaborated. Six typical targets are selected based on fifty filters. The convex optimization algorithm is used to solve the Equations (2). Unlike the previous research, the number of filters used in this paper is fewer, and the spectral data are sparser, so the fitting method is critical. Based on the 50 transmittance curves given in this paper, the best fitting method of the original spectrum and the 50 discrete spectrums obtained by solving Equation (2) re analyzed. In terms of spectral reconstruction evaluation, the three indicators ARE, RE, and MSE are used for evaluation, further improving the accuracy of the spectral reconstruction evaluation. The convex optimization solution method, fitting method, and spectrum evaluation index proposed in this study are unique and promising to advance the field of spectrum reconstruction and are also conducive to the miniaturization of the spectrometer.
The transmittance curve of 50 filters in the wavelength range of 400-900 nm is shown in Figure 39 below.