Extracting Tissue Optical Properties and Detecting Bruised Tissue in Pears Quickly and Accurately Based on Spatial Frequency Domain Imaging and Machine Learning

Recently, Spatial Frequency Domain Imaging (SFDI) has gradually become an alternative method to extract tissue optical properties (OPs), as it provides a wide-field, no-contact acquisition. SFDI extracts OPs by least-square fitting (LSF) based on the diffuse approximation equation, but there are shortcomings in the speed and accuracy of extracting OPs. This study proposed a Long Short-term Memory Regressor (LSTMR) solution to extract tissue OPs. This method allows for fast and accurate extraction of tissue OPs. Firstly, the imaging system was developed, which is more compact and portable than conventional SFDI systems. Next, numerical simulation was performed using the Monte Carlo forward model to obtain the dataset, and then the mapping model was established using the dataset. Finally, the model was applied to detect the bruised tissue of ‘crown’ pears. The results show that the mean absolute errors of the absorption coefficient and the reduced scattering coefficient are no more than 0.32% and 0.21%, and the bruised tissue of ‘crown’ pears can be highlighted by the change of OPs. Compared with the LSF, the speed of extracting tissue OPs is improved by two orders of magnitude, and the accuracy is greatly improved. The study contributes to the rapid and accurate extraction of tissue OPs based on SFDI and has great potential in food safety assessment.


Introduction
The study of the propagation process of light in biological tissue has been a hot issue. It has been found that tissue optical properties (OPs) show great potential in biomedical detection [1,2], OPs' detection of fruit [3,4] and OPs' detection of milk [5]. The propagation behavior of light in biological tissue consists mainly of absorption and scattering, which are generally quantitatively described by the absorption coefficient (µ a ) and the reduced scattering coefficient (µ s ). The µ a reflects the chemical composition of biological tissue, whereas the µ s reflects the physical structural properties of the tissues [6]. Therefore, obtaining µ a and µ s of biological tissue is important for assessing the physicochemical properties of biological tissue. There are various methods to obtain tissue OPs, such as the temporally resolved [7], spatially resolved [8], and integrating sphere methods [9]. As a new method to obtain tissue OPs, Spatial Frequency Domain Imaging (SFDI) is widely used in burned tissue assessment [10], meat classification [11], and bruised fruit detection [12,13]. The SFDI technique is commonly used in the biomedical field, but it is rarely used in food safety evaluation and agricultural product quality assessment.
There are two homogeneous forward models of mapping from OPs to diffuse reflectance in Spatial Frequency Domain Imaging. One model is an analytic approach based on the diffusion approximation equation and another model is based on transport using Monte Carlo (MC) simulations [14,15]. The main task of extracting tissue OPs by transport models is to deal with an inverse process of mapping tissue OPs to spatial frequency

Spatial Frequency Domain Imaging Instrumentation
The Spatial Frequency Domain Imaging system is shown in Figure 1a. The grayscale illumination pattern is generated by a miniature projection module. In this study, we used a digital projector (M1, Lenovo, Beijing, China), based on a digital micromirrorbased digital light processing (DLP) light engine (Texas Instruments, Dallas, TX, USA) and an LED light source. A filter (λ = 525 nm, ∆λ = 10 nm, Beijing Optical Century Instrument co. LTD (BOCIC), Beijing, China) was used in front of the lens of the projector to filter out light with a wavelength of 525 nm. The diffuse light reflected from the sample surface was captured by an 8-bit CCD camera (MV-CA060-11GM, Hikvision, Hangzhou, China). The generation of the illumination pattern, the projection, and the acquisition of the diffuse reflectance image of the sample were implemented by two ARM boards (Jetson Nano, Nvidia Corporation, Santa Clara, CA, USA). The synchronization of the sinusoidal illumination pattern projection and the sample diffuse reflectance acquisition was ensured by network communication. Compared to conventional systems, this study abandoned the strategy of using a personal computer as the control core and used miniature components, making the system more portable and compact.
(LSTM) [29] was proposed to extract OPs, which is not only fast, but also improves accuracy. This work lays a foundation for solving the problem of real-time, accurate, and portable extraction of tissue OPs based on the SFDI technique. The purpose of this study was to look for an alternative approach to extract OPs quickly and accurately from diffuse reflectance images for bruised tissue detection in 'crown' pears. Therefore, the main objectives of this research are as follows: (1) build a compact and portable system; (2) obtain data through Monte Carlo simulation; (3) establish a mapping model; and (4) detect the change of tissue OPs after a 'crown' pear has been bruised.

Spatial Frequency Domain Imaging Instrumentation
The Spatial Frequency Domain Imaging system is shown in Figure 1a. The grayscale illumination pattern is generated by a miniature projection module. In this study, we used a digital projector (M1, Lenovo, Beijing, China), based on a digital micromirror-based digital light processing (DLP) light engine (Texas Instruments, Dallas, TX, USA) and an LED light source. A filter (λ = 525 nm, Δλ = 10 nm, Beijing Optical Century Instrument co. LTD (BOCIC), Beijing, China) was used in front of the lens of the projector to filter out light with a wavelength of 525 nm. The diffuse light reflected from the sample surface was captured by an 8-bit CCD camera (MV-CA060-11GM, Hikvision, Hangzhou, China). The generation of the illumination pattern, the projection, and the acquisition of the diffuse reflectance image of the sample were implemented by two ARM boards (Jetson Nano, Nvidia Corporation, Santa Clara, CA, USA). The synchronization of the sinusoidal illumination pattern projection and the sample diffuse reflectance acquisition was ensured by network communication. Compared to conventional systems, this study abandoned the strategy of using a personal computer as the control core and used miniature components, making the system more portable and compact.

SFDI Processing
For the Spatial Frequency Domain Imaging technique, the sinusoidally modulated light is projected onto the surface of the scattering medium first, and then the raw diffuse reflectance image is captured with a camera. Sinusoidally modulated light at each frequency needs to be projected three times with the phase 0π, 2π/3, and 4π/3. At least two frequencies are required to map the optical properties (OPs) using the optical transport model [30]. The data processing is shown in Figure 1b.

SFDI Processing
For the Spatial Frequency Domain Imaging technique, the sinusoidally modulated light is projected onto the surface of the scattering medium first, and then the raw diffuse reflectance image is captured with a camera. Sinusoidally modulated light at each frequency needs to be projected three times with the phase 0π, 2π/3, and 4π/3. At least two frequencies are required to map the optical properties (OPs) using the optical transport model [30]. The data processing is shown in Figure 1b.
After obtaining the raw diffuse reflectance image, the modulation amplitude ( M(f x )) needs to be obtained by three-phase demodulation, as in Equation (1). where I i (f x ) is the raw diffuse reflectance with different phases at the same frequency, and M(f x ) is the modulation amplitude. The correction is then performed using a reference whiteboard with known diffuse reflectance, as in Equation (2), where M(f x ) measured is the modulated amplitude of the sample, M(f x ) reference is the modulated amplitude of the reference whiteboard, R d (f x ) measured is the diffuse reflectance of the sample, and R d (f x ) reference is the diffuse reflectance of the reference whiteboard. According to the diffuse approximation theory, the optical properties (µ a , µ s ) can be solved using curve fitting based on the diffuse equation [30] after the diffuse reflectance is obtained. This is shown in Equation (3), where µ tr = µ a +µ s is the transport coefficient, µ eff = 3µ a µ tr +2πf x 2 represents the scalar attenuation coefficient in the spatial frequency domain, n is the refractive index of sample, R eff = 0.63n + 0.668 + 0.71/n − 1.44/n 2 is effective reflection coefficient, and A = (1 − R eff )/2(1 + R eff ) is a proportionality constant.

Monte Carlo Simulations
Unlike the diffuse approximation equation, Monte Carlo (MC) simulation is a stochastic statistical method that simulates the transport of photons through tissue. After the photons enter the tissue, they constantly interact, and some of the photons are absorbed and disappear. Photons emitted from the upper surface of the tissue form diffuse light, and photons emitted from the lower surface of the tissue form transmitted light. Given the optical properties (OPs) parameters, the purpose of MC simulations is to simulate the photons transport process and then accurately calculate the corresponding diffuse reflectance. Many researchers have implemented MC simulations programs for different purposes, some for time-domain MC simulations [31], some for single-layer tissue MC simulations, and some for multi-layer tissue MC simulations [32]. This study uses a GPU-accelerated simulations program developed by Eric [33]. A large amount of mapping data (from OPs to diffuse reflectance) was obtained through MC simulations, which was used to construct the Long Short-term Memory Regressor model.
Given the value of the OPs, the diffuse reflectance R d (r) can be obtained using the MC simulations program. However, this spatially distributed diffuse reflectance R d (r) obtained by MC simulations is independent of the frequency of the structured light. The diffuse reflectance R d (f x ) in the spatial frequency domain (SFD) can be derived by Fourier transform [30]. As shown in Equation (4), where R d (f x ) is diffuse reflectance in SFD, r i is the radial distance of the ith photon from the incident point of the light source in the MC simulation, f x is the frequency of the sinusoidally modulated light, R d (r i ) is the reflection weight of the photon at the point r i , ∆r i is the distance between radially adjacent photons, and J 0 is the zeroth-order Bessel function of the first kind. The initialization parameters of MC simulations are shown in Table 1.  1 The symbols corresponding to the parameters. 2 The thickness of each tissue layer in the Monte Carlo simulations. 3 The thickness of each tissue layer in the radial direction of the light source.

Long Short-Term Memory Regressor Method
The Long Short-term Memory (LSTM) network model has great potential to solve problems where input sequences have context relations. Meanwhile, the LSTM network model performs very well in solving complex nonlinear problems. Therefore, this study decided to build a mapping model based on a LSTM network model for mapping tissue optical properties (OPs) from diffuse reflectance.
The Long Short-term Memory Regressor (LSTMR) model takes the n-dimensional diffuse reflectance vector and maps it to a 2-dimensional OPs vector. The input of the LSTM network is generally an n-dimensional vector with dimensions from 1 to n representing n moments. The LSTM has a memory cell that records the memory of each moment. Furthermore, the operations at each moment include adding memory and deleting memory to extract the relevant details of the context. The structure of the LSTMR model is shown in Figure 2, where the n-dimensional vector is the diffuse reflectance at different frequencies.
The model of the network could be a deep neural network, and only one layer of the neural network is shown in the figure. The basic structure of the model is shown in the upper of Figure 2, and equations are shown in Equations (5)-(10), where is the pointwise multiplication operation, σ is the sigmoid function, W is the weight matrix of the network layer, z is the bias term of the network layer, F t is the forget gate, =I t is the input gate, C t is the current memory, O t is the output gate, C t is the memory cell at moment t, h t is the output at moment t, and X t is the input at moment t. LSTM modifies the content of the memory cell through all the forget and input gates to extract context-related information. The final output of the model can be written as Equation (11), where w t is the weight of the output corresponding to each component of the input vector, and µ a and µ s are the OPs. where w t is the weight of the output corresponding to each component of the input vector, and µ a and µ ' s are the OPs. The Long Short-term Memory Regressor model was constructed based on the PyTorch framework (PyTorch, version 1.10.0+cu113, Meta, Menlo Park, CA, USA), which is a mainstream framework for building machine learning models. To obtain reliable and stable models, five-fold cross-validation was used in the optimization of model parameters. Theoretically, if there are enough nodes, an artificial neural network with one hidden layer can fit any complex function. This study obtained the best results when the number of nodes was 2 5 and the number of hidden layers was 5. Too small a batch size will lead to model oscillation and difficult convergence. Setting the batch size to the training set size is a good choice due to the small dataset, and choosing the Resilient Propagation optimizer, which is preferred when the batch size is equal to the training set size, has proven to be a smart choice. When the initial learning rate of the model was 0.0001, the model had a good convergence effect, and the model converged quickly before 200 epochs. Finally, the dropout algorithm was used to prevent overfitting, and the final model training took 30 min.

Simulations Experiments
The Long Short-term Memory Regressor (LSTMR) model was tested using a simulated dataset, and the tested dataset never appeared in the training dataset. To accelerate the inversion speed, the two-frequency inversion strategy is usually adopted. In this study, there were six alternative frequencies (f x = 0.167, 0.180, 0.200, 0.220, 0.250, 0.300 mm −1 ). Different mapping models were built with different high frequencies, and a fivefold cross-validation was used in the model-building process. Different models were used to map the optical properties (OPs), and then the mean absolute error of OPs was used as the basis for the preference.
After determining the optimal frequency, the full set of training dataset was used to train the Long Short-term Memory Regressor mapping model. To highlight the advantages of the model, least-square fitting (LSF), artificial neural network (ANN), random forest regressor (RFR), and recurrent neural networks (RNN) mapping methods were implemented in the experiments, respectively. The strengths and weaknesses of the models The Long Short-term Memory Regressor model was constructed based on the PyTorch framework (PyTorch, version 1.10.0+cu113, Meta, Menlo Park, CA, USA), which is a mainstream framework for building machine learning models. To obtain reliable and stable models, five-fold cross-validation was used in the optimization of model parameters. Theoretically, if there are enough nodes, an artificial neural network with one hidden layer can fit any complex function. This study obtained the best results when the number of nodes was 2 5 and the number of hidden layers was 5. Too small a batch size will lead to model oscillation and difficult convergence. Setting the batch size to the training set size is a good choice due to the small dataset, and choosing the Resilient Propagation optimizer, which is preferred when the batch size is equal to the training set size, has proven to be a smart choice. When the initial learning rate of the model was 0.0001, the model had a good convergence effect, and the model converged quickly before 200 epochs. Finally, the dropout algorithm was used to prevent overfitting, and the final model training took 30 min.

Simulations Experiments
The Long Short-term Memory Regressor (LSTMR) model was tested using a simulated dataset, and the tested dataset never appeared in the training dataset. To accelerate the inversion speed, the two-frequency inversion strategy is usually adopted. In this study, there were six alternative frequencies (f x = 0.167, 0.180, 0.200, 0.220, 0.250, 0.300 mm −1 ). Different mapping models were built with different high frequencies, and a five-fold crossvalidation was used in the model-building process. Different models were used to map the optical properties (OPs), and then the mean absolute error of OPs was used as the basis for the preference.
After determining the optimal frequency, the full set of training dataset was used to train the Long Short-term Memory Regressor mapping model. To highlight the advantages of the model, least-square fitting (LSF), artificial neural network (ANN), random forest regressor (RFR), and recurrent neural networks (RNN) mapping methods were implemented in the experiments, respectively. The strengths and weaknesses of the models were evaluated by the normalized mean absolute error (NMAE), the determination coefficient (R 2 ), the root mean square error (RMSE), and the mean absolute error (MAE). Look-up table inversion was not chosen because it required a tradeoff in time and accuracy.

Phantoms Experiments
By using Indian ink (Royal Talens, Apeldoorn, The Netherlands) as an absorbing agent and titanium dioxide (T104950-500 g, Aladdin Biochemical Technology Corporation., Shanghai, China) as a scattering agent, deionized-water-based optical phantoms were prepared. Five gradients were set for absorption and reduced scattering, respectively. The volume fraction of India ink is 0.006-0.014% with a 0.002% interval and the volume fraction of TiO 2 is 0.04-0.12% with a 0.02% interval. Twenty-five small liquid phantoms with various optical properties (OPs) were fabricated. The absorption range of these phantoms was from 0.0945 mm −1 to 0.1905 mm −1 , and the scattering range was from 1.3689 mm −1 and 4.1063 mm −1 . According to Lambert's law, the standard value of the absorption coefficient was derived using the collimated transmittance T, and the collimated transmittance T is obtained by spectrometer acquisition (QE65pro, Ocean Insight Corporation, Orlando, FL, USA), as shown in Equation (12), where D is the length of the optical path passed in the liquid during collimated transmission, and I 0 and I are the transmitted light intensity of water and the transmitted light intensity of the absorber, respectively. The standard value of the reduced scattering coefficient can be calculated by using the Mie program [34] given the parameters of TiO 2 , the refractive index of water, and the wavelength of light. The parameters of TiO 2 include diameter, volume fraction, and refractive index.
The phantom experiments were performed using a two-frequency strategy (high frequency is the optimal frequency 0.25 mm −1 ) and an inversion was performed using the Long Short-term Memory Regressor (LSTMR), the least-square fitting (LSF), the artificial neural network (ANN), the random forest regressor (RFR), recurrent neural network (RNN), respectively. A 300 × 300-pixel area near the center pixel of each phantom was selected as the target area and the OPs images were computed.

Pear Experiments
'Crown' pears were selected as experimental objects, and all crown pears came from fruit supermarkets. The surface of these pears was not damaged, and they were very fresh. The experiments were conducted in March at an ambient temperature of 20 degrees Celsius. During the bruising treatment, the pendulum motion was simulated by using a small iron ball to hit the pear around the equator, thus inducing the formation of bruised tissue. During the experiments, the experimental subjects were consistent before and after bruising, and the images of normal pears were collected first, and then the images of bruised pears were collected after bruising treatment. All experimental procedures used the same system to acquire images and the same program to extract optical properties.

Simulation Experiment Results
To obtain the best high frequency, the mapping models with different high frequencies were built based on the training dataset, and the most suitable high frequencies were determined in the range of 0.167-0.300 mm −1 . Figure 3 illustrates the mean absolute error (MAE) of the optical properties (OPs), where the horizontal axis is the mapping model for different high frequencies. The results show that the model has the best accuracy when the frequency is chosen to be 0.25 mm −1 , and when the MAE of the absorption coefficient (µ a ) and the reduced scattering coefficient (µ s ) are 0.6240% and 0.5939%, respectively. The optimal frequency of 0.25 mm −1 is very close to the commonly used optimal frequency of 0.2 mm −1 , which is consistent with the experimental results of Luo's frequency preference [5]. The optimal frequency of 0.25 mm −1 is very close to the commonly used optimal frequency of 0.2 mm −1 , which is consistent with the experimental results of Luo's frequency preference [5]. The prediction results of different models are shown in Table 2. The prediction results of the Long Short-term Memory (LSTMR) are optimal in terms of normalized mean absolute error (NMAE), MAE, root mean square error (RMSE), and determined coefficient (R 2 ). Except for the LSTMR model, the RFR model has the best prediction results. For LSTMR, the MAE of the µ a and the µ ' s are 0.32% and 0.21%, respectively. This is an order-ofmagnitude improvement compared to the prediction accuracy of the LSF. As shown in Figure 4, there is an extremely high linearity between the predicted and target values of the LSTMR, with the R 2 approaching 1. As can be seen in Figure 4, the target and predicted values almost exactly coincide and overlap in a straight line, both for the µ a and the µ ' s . This indicates that the model is an excellent fitting and that the model fits well as a function of the diffuse reflectance and OPs. The experiments illustrate that LSTMR is an ideal model for accurately mapping OPs.  The prediction results of different models are shown in Table 2. The prediction results of the Long Short-term Memory (LSTMR) are optimal in terms of normalized mean absolute error (NMAE), MAE, root mean square error (RMSE), and determined coefficient (R 2 ). Except for the LSTMR model, the RFR model has the best prediction results. For LSTMR, the MAE of the µ a and the µ s are 0.32% and 0.21%, respectively. This is an orderof-magnitude improvement compared to the prediction accuracy of the LSF. As shown in Figure 4, there is an extremely high linearity between the predicted and target values of the LSTMR, with the R 2 approaching 1. As can be seen in Figure 4, the target and predicted values almost exactly coincide and overlap in a straight line, both for the µ a and the µ s . This indicates that the model is an excellent fitting and that the model fits well as a function of the diffuse reflectance and OPs. The experiments illustrate that LSTMR is an ideal model for accurately mapping OPs.

Phantoms Experiments Results
To verify that the proposed Long Short-term Memory Regressor (LSTMR) mapping model can be used to extract optical properties (OPs) accurately and quickly, 25 optical phantoms with known OPs were produced. As shown in Table 3, LSTMR mapped OPs at a speed of 253 ms for a 300 × 300-pixel image (CPU, Intel-I7-11800H). However, for the least-square fitting (LSF) method, extracting the OPs of a 300 × 300-pixel image took 57,970 ms. The results show that the LSTMR inversion speed is improved by 2 to 3 orders of magnitude compared to LSF. The speed of predicting tissue OPs based on machine learning methods depends on the complexity of the model (number of nodes and number the MAE of the µ a and the µ ' s are 0.32% and 0.21%, respectively. This is an order-ofmagnitude improvement compared to the prediction accuracy of the LSF. As shown in Figure 4, there is an extremely high linearity between the predicted and target values of the LSTMR, with the R 2 approaching 1. As can be seen in Figure 4, the target and predicted values almost exactly coincide and overlap in a straight line, both for the µ a and the µ ' s . This indicates that the model is an excellent fitting and that the model fits well as a function of the diffuse reflectance and OPs. The experiments illustrate that LSTMR is an ideal model for accurately mapping OPs.   The results of different inversion methods for the phantoms experiments are shown in Figures 5 and 6, and the mean absolute error (MAE) of µ a and µ s are 0.0211 and 0.0674 using the LSTMR method, respectively. Furthermore, the R 2 of µ a and µ s are 0.9916 and 1.0, respectively, which indicates that the predicted results of LSTMR have a good linear relationship with the expected values. It confirms that LSTMR is an ideal choice for inversion in Spatial Frequency Domain Imaging. Due to the inevitable experimental error, the actual value of the phantom is different from the reference value, so the prediction result of the phantom would be slightly worse than the simulation result. The relative error of µ s is larger than that of µ a because the scattering agent is easily precipitated and is more influenced by whether the liquid surface is stationary or not, resulting in a larger error in the prediction of µ s . Obviously, the mapping results of the LSTMR inversion model are better than other models in the experiments.

Pear Experiment Results
The results of the bruised tissue detection experiment for pears are shown in Figures  7 and 8. Pears will form bruised tissue at an early stage after being slightly crushed. In this study, it was demonstrated that bruised tissue forms on the surface of the pear after a slight impact. The absorption coefficient of the tissue increases during the formation of bruised tissue. The opposite is true for the reduced scattering coefficient, which is consistent with the experimental results of Sun [25] and Luo [35]. Moreover, both absorption and reduced scattering images could highlight the areas of bruised tissue. Therefore, using the Spatial Frequency Domain Imaging technique, early bruised detection of fruits can be performed. Furthermore, it can effectively control the bruised of fruits during transportation, thus controlling the cost of the fruit industry. The optical properties (OPs) of apple tissues can be used for nondestructive quality or ripeness prediction of apples [4], and the Long Short-term Memory method proposed in this study can obtain prediction results more accurately and quickly. Therefore, the rapid acquisition of OPs in tissues is of particular importance. This further illustrates the need to improve the speed and accuracy of extracting the OPs of tissues. It also lays the foundation for the real-time, portable acquisition of tissue OPs.

Pear Experiment Results
The results of the bruised tissue detection experiment for pears are shown in Figures 7 and 8. Pears will form bruised tissue at an early stage after being slightly crushed. In this study, it was demonstrated that bruised tissue forms on the surface of the pear after a slight impact. The absorption coefficient of the tissue increases during the formation of bruised tissue. The opposite is true for the reduced scattering coefficient, which is consistent with the experimental results of Sun [25] and Luo [35]. Moreover, both absorption and reduced scattering images could highlight the areas of bruised tissue. Therefore, using the Spatial Frequency Domain Imaging technique, early bruised detection of fruits can be performed. Furthermore, it can effectively control the bruised of fruits during transportation, thus controlling the cost of the fruit industry. The optical properties (OPs) of apple tissues can be used for nondestructive quality or ripeness prediction of apples [4], and the Long Shortterm Memory method proposed in this study can obtain prediction results more accurately and quickly. Therefore, the rapid acquisition of OPs in tissues is of particular importance. This further illustrates the need to improve the speed and accuracy of extracting the OPs of tissues. It also lays the foundation for the real-time, portable acquisition of tissue OPs.

Discussion
Absorption and scattering have different sensitivities to frequency. Absorption is mainly sensitive to low frequency, whereas scattering is mainly sensitive to high frequency. The non-zero frequency should not be too large or too small for the two-frequency

Discussion
Absorption and scattering have different sensitivities to frequency. Absorption is mainly sensitive to low frequency, whereas scattering is mainly sensitive to high frequency. The non-zero frequency should not be too large or too small for the two-frequency

Discussion
Absorption and scattering have different sensitivities to frequency. Absorption is mainly sensitive to low frequency, whereas scattering is mainly sensitive to high frequency. The non-zero frequency should not be too large or too small for the two-frequency inversion. The simulations experimental results showed that f x = 0.25 mm −1 was the most suitable frequency under these experimental conditions, which was also closer to the non-zero frequency used in the existing literature [5]. The simulations experimental results show that the mapping accuracy of the Long Short-term Memory Regressor (LSTMR) model could be substantially improved, and the mean absolute error (MAE) of µ a and µ s could reach 0.32% and 0.21%, respectively. The mapping accuracy of LSTMR is much better than that of the traditional LSF method, and it also performs better than the other machine learning methods in the experiments. Compared with the LSF method, the phantoms experiment not only shows that LSTMR has an advantage in mapping accuracy, but also has a huge performance advantage in inversion speed.
Jäger et al. [23] combined spatial resolution technology with multiple artificial neural network to extract optical properties (OPs). According to their reports, the normalized mean absolute errors (NMAEs) of µ a and µ s are 6.1% and 2.9%, respectively. The MAE of the deep neural network mapping model proposed by Stier [1] for µ s is 6.8%. Song [28] developed an OPs mapping model based on the deep neural network, and according to their study, the mean and standard deviation of the percentage errors of µ a and µ s were 0.0 ± 1.4 and 0.0 ± 0.28%, respectively. Sun proposed an artificial neural network method [25] for the inversion of OPs based on multi-frequency inversion, where the NMAEs of µ a and µ s are 0.18% and 0.027%, respectively. Sun used seven frequencies for inversion, whereas we used only two frequencies to achieve comparable accuracy. Panigrahi [26] demonstrated that the random forest regressor (RFR) method was a highly accurate and fast inversion method, and the MAE of OPs could be reduced to 0.556% and 0.126%, respectively. Comparing the MAE, it could be found that the µ a of LSTMR was more accurate, whereas the µ s of RFR was more accurate. The µ s of LSTMR is slightly less accurate than RFR due to the large gradient (the interval of µ s is 0.126 mm −1 ) of the µ s of the dataset.
The phantom experimental results showed that the LSTMR not only has better inversion accuracy than other methods, but also had a dramatic improvement in inversion speed, with a speed improvement of 2 to 3 orders of magnitude compared to the LSF. The LSF method requires continuous iterations for optimization until the error is within an acceptable range, which consumes a lot of time during the iterations, and which is evident as the number of frequency increases. The look-up table uses a search strategy in which the time taken for the search process increases exponentially as the number of frequencies increases. However, using multiple spatial frequencies for inversion can improve the robustness of the model [18]. The machine learning method can solve the slow speed problem in the process of multi-frequency inversion, and the mapping accuracy can be improved at the same time. As can be seen from Table 3, LSTMR is more than 100 times faster than LSF. This is also consistent with the results of Zhao's study [27] and Song's study [28].

Conclusions
The proposed Long Short-term Memory Regressor (LSTMR) method is an ideal mapping model to replace the inversion method based on the optical transport model. It can quickly extract optical properties (OPs), but without loss of estimation accuracy. This study not only compared the LSTMR method to the traditional LSF method, but also to other machine learning methods that appeared in journals, and it turns out that the LSTMR method is indeed a good choice. The experimental results show that the accuracy of LSTMR inversion is comparable to or even better than that of the previous literature. Furthermore, the speed of LSTMR is improved by 2~3 orders of magnitude compared with LSF. These pear experiments proved that LSTMR can accurately distinguish bruised tissue, which provides a feasible solution for the quality assessment of pears. All experiments are based on our developed miniaturized Spatial Frequency Domain Imaging system. This study laid the hardware foundation and method foundation for real-time and portable OPs acquisition of pears, and further applied it to pear quality evaluation.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author upon reasonable request.