**1. 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 μ<sup>a</sup> reflects the chemical composition of biological tissue, whereas the μ <sup>s</sup> reflects the physical structural properties of the tissues [6]. Therefore, obtaining μ<sup>a</sup> and μ <sup>s</sup> 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

**Citation:** Xing, S.; Zhang, J.; Luo, Y.; Yang, Y.; Fu, X. Extracting Tissue Optical Properties and Detecting Bruised Tissue in Pears Quickly and Accurately Based on Spatial Frequency Domain Imaging and Machine Learning. *Foods* **2023**, *12*, 238. https://doi.org/10.3390/ foods12020238

Academic Editors: Mourad Kharbach and Samuli Urpelainen

Received: 20 November 2022 Revised: 28 December 2022 Accepted: 29 December 2022 Published: 4 January 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

diffuse reflectance. There are two ways to implement the inversion process, one is the error minimization, and the other is the search method. For the first approach, the error minimization problem (min ∑ Rd,model(fx) − Rd,sample(fx) ) is solved by inputting a guess value of the optical properties into the model to obtain the diffuse reflectance (Rd,model) closest to the actual value (Rd,sample). The second approach is a search problem, which first generates a large amount of data using a forward model and then compares the diffuse reflectance of the sample and dataset to find the optical properties values. Regardless of which forward model is used, there are two common methods used for inversion so far. One is the least-square fitting (LSF) method, and the other is the look-up table (LUT) method [16,17]. Generally, to obtain accurate and stable results, diffuse reflectance at multiple spatial frequencies is used [18,19]. However, whether using analytic approach based on the diffusion approximation equation or MC simulations based on transport, the LSF is computationally slow and unsuitable for fitting large numbers of pixels, which is an inherent drawback of the fitting method. The LUT method generates a diffuse reflectance dataset from a forward model and then builds a mapping table from diffuse reflectance to OPs, and the inversion process usually uses interpolation to estimate the OPs. In theory, if the interval of the LUT is small enough, extremely high inversion accuracy can be obtained. However, with the decrease of LUT interval and the increase of frequency number, the inversion time increases exponentially. The LUT therefore requires a compromise between accuracy and speed. In conclusion, traditional inversion methods are not good to balance accuracy and speed at the same time. Therefore, it is necessary to improve the speed and accuracy of SFDI inversion to quantify the OPs of tissue quickly and accurately.

Machine learning is widely used in visual inspection [20], quality assessment of agricultural products [21], and metal material research [22]. Since machine learning techniques have great advantages in dealing with regression problems with large amounts of data, they are used to replace the time-consuming model-based inversion process in diffuse reflectance optics [23,24]. The mapping between OPs and diffuse reflectance is strongly nonlinear in SFDI. Meanwhile, machine learning and regression techniques were found to be highly advantageous in solving nonlinear problems; for example, an artificial neural network (ANN) implementation for extraction of tissue OPs [25], and extraction of tissue OPs based on random forest regressor (RFR) [26]. According to the literature [27,28], machine learning-based extraction of OPs can be two orders of magnitude faster than conventional methods, without degrading the accuracy of OPs, based on the SFDI technique. Although these methods are based on machine learning, which greatly improves the prediction speed, the prediction accuracy is still lacking.

The analysis of OPs allows for the assessment of physiological indicators such as firmness and Soluble Solids Content (SSC) [6], which helps in the evaluation and classification of fruits. Fruits are prone to receive crushing and bruising during the picking, transportation, and marketing process. Over time, the bruised tissues of pears will decay and spread to the surrounding tissue, which eventually leads to a decrease in the economic efficiency of pears. Furthermore, it is a good mean to detect the bruised tissue of fruits by Ops. Therefore fast, accurate, and portable extraction of tissue OPs is of great importance in agricultural production and food safety.

Researchers have been looking for fast and accurate inversion methods, aiming to achieve real-time, accurate, and portable extraction of tissue OPs based on the SFDI technique. Common mapping models based on machine learning methods are used to extract OPs, which greatly improve the prediction speed and prediction accuracy. However, accuracy is still lacking. In this study, a mapping method based on Long Short-term Memory (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.
