Fruit internal quality detection method based on spatial resolution spectrum
Through the internal quality detection method of fruit based on spatially resolved spectrum, combined with nonlinear fitting inversion and Monte Carlo optical transmission model, the problem of low internal quality detection accuracy in fruits in the existing technology is solved, and accurate detection and evaluation of internal defects of fruits is achieved to meet the market's demand for high-quality fruit detection.
Patent Information
- Application Number
- CN202510354837.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure CN120160994A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fruit quality detection, and particularly relates to a method for detecting the internal quality of fruits based on spatially resolved spectroscopy. Background Art
[0002] With the continuous improvement of consumers' requirements for fruit quality, fruit quality detection technology has also become a research focus. Fruit quality detection includes appearance detection and internal detection. External detection is usually applicable to some low - requirement scenarios, relying on image recognition technology to quickly obtain fruit appearance characteristics. Internal detection is more comprehensive and complex. Some studies have proposed using direct measurement methods for detection, but this method has extremely strict requirements for experimental conditions. Due to the diverse shapes and complex structures of fruits, quantitative analysis is extremely inconvenient and the implementation difficulty is relatively large. There are also studies that have proposed an optical non - destructive detection technology for establishing a model of the concentration of target components and absorbance, but this technology ignores the complex light propagation process inside the fruit tissue, resulting in the loss of key information such as absorption coefficient and scattering coefficient, and further leading to poor model stability, poor adaptability, and low analysis accuracy, making it difficult to meet the market's demand for high - quality fruit detection.
[0003] In view of this, there is a need for a method for detecting internal quality defects of fruits based on spatially resolved spectroscopy. Summary of the Invention
[0004] The present invention provides a method for detecting internal quality defects of fruits based on spatially resolved spectroscopy, which is used to solve the problem that the results of fruit internal quality detection are difficult to meet market requirements.
[0005] The present invention provides a method for detecting internal quality defects of fruits based on spatially resolved spectroscopy, including:
[0006] Vertically irradiate the surface of a fruit sample with a continuous - wave light beam with preset parameters, collect reflected light signals at different spatial positions from the light source using a light detector, and calculate the spatially resolved reflectance distribution of the fruit at multiple wavelengths based on the reflected light signals;
[0007] Perform non - linear fitting inversion on the spatially resolved reflectance distributions at the multiple wavelengths to extract the variation relationship of the reduced scattering coefficient of the internal tissue of the fruit with wavelength;
[0008] According to the mapping model between the reduced scattering coefficient and the optical properties of the pulp tissue, determine the set of optical property parameters of the target pulp tissue;
[0009] Input the set of optical property parameters into a Monte Carlo light transport model to simulate the propagation path and energy distribution characteristics of light with different wavelengths inside the fruit, and generate light propagation simulation data;
[0010] Based on the comparative analysis of the optical propagation simulation data and a preset quality assessment threshold, determine whether there is an optical abnormal area inside the fruit;
[0011] If there is an optical abnormal area, output the corresponding defect type, three-dimensional positioning coordinates, and defect level parameters according to the degree of deviation of the optical characteristics and the spatial position information of the abnormal area.
[0012] Furthermore, the non-linear fitting inversion of the spatial resolved reflectance distribution at multiple wavelengths to extract the relationship between the reduced scattering coefficient of the internal tissue of the fruit and the wavelength includes:
[0013] Obtain the initial absorption coefficient inside the fruit sample;
[0014] Set the fitting coefficients and intermediate variables in the fitting formula, and calculate the corresponding reduced scattering coefficient using the set fitting formula;
[0015] Calculate the predicted reflectance of the diffusion model at different distances based on the calculated reduced scattering coefficient and the initial absorption coefficient;
[0016] Determine the reduced scattering coefficient inside the fruit by adjusting the error between the spatial resolved reflectance and the predicted reflectance.
[0017] Furthermore, the calculating the predicted reflectance of the diffusion model at different distances based on the calculated reduced scattering coefficient and the initial absorption coefficient includes:
[0018] Expression of the diffusion model:
[0019]
[0020] Where: R(r) is the reflectance at a distance r from the light source, r is the source-detector distance, D is the diffusion coefficient, r1 and r2 are coefficients related to the source-detector distance r, μ eff is the effective attenuation coefficient, μ′ eff is a parameter related to the effective attenuation coefficient, C1 and C2 are constants, μ′ t is the total attenuation coefficient, z b is a parameter related to the sample boundary condition or geometry.
[0021] Furthermore, the determining the reduced scattering coefficient inside the fruit by adjusting the error between the spatial resolved reflectance and the predicted reflectance includes:
[0022] Calculate the error between the spatial resolved reflectance and the predicted reflectance using the least squares method;
[0023] Adjust the fitting coefficients and intermediate variables according to the calculated error, and substitute the adjusted fitting coefficients and intermediate variables into the fitting formula to obtain a new reduced scattering coefficient;
[0024] Calculate the new predicted reflectance according to the diffusion model, recalculate the error, and determine the reduced scattering coefficient at the minimum error as the reduced scattering coefficient inside the fruit.
[0025] Furthermore, according to the mapping model between the reduced scattering coefficient and the optical properties of the pulp tissue, determine the set of optical property parameters of the target pulp tissue, including:
[0026] Calculate the absorption coefficient inside the fruit according to the reduced scattering coefficient inside the fruit;
[0027] Calculate the target optical property data of the pulp tissue inside the fruit based on the reduced scattering coefficient and absorption coefficient inside the fruit.
[0028] Furthermore, input the set of optical property parameters into the Monte Carlo light transport model to simulate the propagation path and energy distribution characteristics of light with different wavelengths inside the fruit, and generate light propagation simulation data, including:
[0029] Initialize the Monte Carlo simulation parameters, and set the initial state of photons and the parameters of each layer of fruit tissue;
[0030] Calculate the step size, weight, and scattering direction by simulating the propagation of photons in the fruit tissue;
[0031] Process reflection and transmission according to the boundary conditions and update the photon position;
[0032] Obtain the absorption rate, diffuse reflectance, and diffuse transmittance of light inside the fruit by standardizing the statistical photon behavior data.
[0033] Furthermore, the calculating the step size, weight, and scattering direction by simulating the propagation of photons in the fruit tissue includes:
[0034] Expressions for calculating the step size and weight:
[0035] Δw = w(1―exp(―μ α (v)·s))
[0036] where: Δw is the absorption intensity of the photon, w is the current weight of the photon, μ α (v) is the absorption coefficient of the tissue at the current position, and s is the step size of the photon;
[0037] Scattering direction calculation formula:
[0038]
[0039] ψ = 2πδ
[0040] where: p(cosθ) is the probability distribution of the cosine of the deflection angle cosθ, g is the anisotropy factor, reflecting the directionality of photon scattering, g ∈ [―1, 1], θ is the deflection angle of photon scattering, θ ∈ [0, π]; cos(θ) is the cosine value of the deflection angle, δ is a random coefficient used to determine cosθ; ψ is the azimuth angle, ψ ∈ [0, 2π].
[0041] Further, the processing of reflection and transmission according to the boundary conditions and updating the photon position includes:
[0042] When a photon encounters a tissue interface before moving, calculate the incident angle and the refraction angle when the photon passes through the tissue boundary according to the refractive index distribution of the tissues on both sides of the boundary;
[0043] Based on the reflection coefficient, calculate the moving direction when the photon is reflected or the moving direction when the photon is transmitted respectively;
[0044] Update the photon position according to the step size and moving direction of the photon.
[0045] Further, the processing of reflection and transmission according to the boundary conditions and updating the photon position includes:
[0046] Calculation formulas for the incident angle and the refraction angle:
[0047]
[0048] where: cosθ′ and cosθ′ t are respectively the cosine values of the incident angle and the refraction angle of the photon, (a, b, c) is the normal vector of the tissue boundary. μ x , μ y , μ z are the components of the current propagation direction of the photon, n1 is the refractive index of the tissue where the photon is currently located, and n2 is the refractive index of the tissue where the photon will move to the next position;
[0049] Calculation formula for the moving direction when the photon is reflected:
[0050]
[0051] where: μ′ x1 , μ′ y1 , μ′ z1 are the components of the propagation direction of the photon after reflection, μ x1 , μ y1 , μ z1 are the components of the propagation direction of the photon before reflection;
[0052] Calculation formula for the moving direction when the photon is transmitted:
[0053]
[0054] Wherein: μ′ x2 , μ′ y2 , μ′ z2 is the component of the propagation direction of the photon after reflection, and μ x2 , μ y2 , μ z2 is the component of the propagation direction of the photon before reflection;
[0055] Photon position update formula:
[0056]
[0057] Wherein: x, y, z are the position coordinates of the photon after update.
[0058] Furthermore, if there is an optical abnormal area, according to the deviation degree of the optical characteristics and the spatial position information of the abnormal area, the corresponding defect type, three-dimensional positioning coordinates and defect level parameters are output, including:
[0059] When all evaluation indicators in the simulation results are within the preset normal range, the defect type is determined according to the matching degree between the change characteristics of the optical propagation characteristic index data obtained by Monte Carlo simulation and the optical propagation characteristic modes corresponding to different defect types;
[0060] Based on the corresponding position of the area where the optical propagation is abnormal in the Monte Carlo simulation in the fruit geometric model, combined with the spatial coordinate information where the optical propagation characteristics change in the simulation data, the location of the defect is determined;
[0061] The severity of the defect is determined according to the size of the defect area and the degree of influence of the defect area on the optical propagation characteristics.
[0062] It can be seen from the above technical solutions that the present invention has the following advantages:
[0063] By calculating the spatially resolved reflectance at different wavelengths, the present invention can accurately obtain the optical response information of fruits at various positions and wavelengths; by calculating the reduced scattering coefficient to analyze the physical properties inside the fruits, and using the fitting inversion calculation method based on the physical model of light propagation, the information in the measurement data can be fully utilized to reduce the influence of measurement errors; taking the determined optical properties as the input parameters of Monte Carlo simulation for simulation analysis, the complex propagation process of light inside the fruits can be realistically simulated to determine the light propagation path and energy distribution inside the fruits; when it is judged that the internal quality evaluation result of the fruits meets the preset conditions, the defect type, the location of the defect, and the severity of the defect inside the fruits are further determined, and the quality problems existing in the fruits can be accurately located; finally, according to the type, location, and severity of the defects, producers and sellers can formulate targeted quality control strategies, thereby improving the overall quality of the fruits and reducing cost losses. Description of the Drawings
[0064] Figure 1 FIG. is a schematic flowchart of an embodiment of a method for detecting internal quality defects of fruits based on spatially resolved spectroscopy provided by the present invention. Detailed Embodiments
[0065] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0066] In this embodiment, the method for detecting internal quality defects of fruits based on spatially resolved spectroscopy is used to improve the detection efficiency and accuracy of internal defects of fruits. The implementation method in this embodiment can be implemented in a system, can be implemented on a server, or can be implemented on a terminal, and no specific limitation is made.
[0067] Embodiment 1
[0068] Please refer to Figure 1 , an embodiment of a method for detecting internal quality defects of fruits based on spatially resolved spectroscopy in the present invention includes the following steps:
[0069] S11. Vertically irradiate the surface of the fruit sample with a continuous wave beam with preset parameters, collect the reflected light signals at different spatial positions from the light source using a light detector, and calculate the spatially resolved reflectance distribution of the fruit at multiple wavelengths based on the reflected light signals;
[0070] Select a light source that can emit a continuous-wave beam with preset parameters, and determine the wavelength range and light intensity based on the response differences of fruits to light of different wavelengths and the measurement requirements. Select representative fruit samples with clean surfaces, and arrange light detectors at different distances and angles around the light source to collect reflected light signals. The light detectors synchronously collect the reflected light signals at different positions. Collect parameter information such as reflected light intensity, collection time, and light source parameters multiple times. Obtain the incident light intensity, and the reflectivity can be measured or calculated based on the light source parameters to determine the change in reflectivity of the fruit at different positions and wavelengths.
[0071] S12. Perform non-linear fitting inversion on the spatially resolved reflectivity distributions at multiple wavelengths, and extract the relationship between the reduced scattering coefficient of the internal tissues of the fruit and the wavelength;
[0072] S121. Obtain the initial absorption coefficient inside the fruit sample;
[0073] Collect the absorption coefficient data of the same type of fruit in a similar growth environment and maturity as the reference value of the initial absorption coefficient.
[0074] S122. Set the fitting coefficients and intermediate variables in the fitting formula, and calculate the corresponding reduced scattering coefficient using the set fitting formula;
[0075] Select a suitable fitting formula based on the data of light propagation in the fruit tissue, assign initial values to the fitting coefficients in the fitting formula, substitute the set fitting coefficients and intermediate variables into the fitting formula, and calculate the corresponding reduced scattering coefficient.
[0076] S123. Calculate the predicted reflectivity of the diffusion model at different distances based on the calculated reduced scattering coefficient and the initial absorption coefficient;
[0077] The expression of the diffusion model here is:
[0078]
[0079] where: T(r) is the reflectivity at a distance r from the light source, r is the source-detector distance, D is the diffusion coefficient, r1 and r2 are coefficients related to the source-detector distance r, μ eff is the effective attenuation coefficient, μ′ eff is a parameter related to the effective attenuation coefficient, C1 and C2 are constants, μ′ t is the total attenuation coefficient, z b is a parameter related to the sample boundary conditions or geometric shape.
[0080] S124. Determine the reduced scattering coefficient inside the fruit by adjusting the error between the spatially resolved reflectivity and the predicted reflectivity.
[0081] Step S124 includes the following:
[0082] 1. Calculate the error between the spatially resolved reflectance and the predicted reflectance using the least squares method;
[0083] 2. Adjust the fitting coefficients and intermediate variables according to the calculated error, and substitute the adjusted fitting coefficients and intermediate variables into the fitting formula to obtain a new reduced scattering coefficient;
[0084] 3. Calculate the new predicted reflectance according to the diffusion model, recalculate the error, and determine the reduced scattering coefficient when the error reaches the minimum as the reduced scattering coefficient inside the fruit.
[0085] Specifically, recalculate the reduced scattering coefficient, predicted reflectance, and error after each adjustment until the error reaches a small threshold or no longer decreases significantly. The reduced scattering coefficient obtained at this time is the result that more accurately reflects the internal characteristics of the fruit after optimization.
[0086] S13. Determine the set of optical property parameters of the target pulp tissue according to the mapping model between the reduced scattering coefficient and the optical properties of the pulp tissue;
[0087] 1. Calculate the absorption coefficient inside the fruit according to the reduced scattering coefficient inside the fruit;
[0088] 2. Calculate the target optical property data of the pulp tissue inside the fruit based on the reduced scattering coefficient and absorption coefficient inside the fruit.
[0089] First, select an appropriate calculation model according to the light propagation theory to establish the correlation between the reduced scattering coefficient and the absorption coefficient. Determine the parameters required by the model. Except for the reduced scattering coefficient, other parameters can refer to the literature, experimental measurements, or empirical estimates. Then, use the iterative algorithm to solve the absorption coefficient, and verify the reliability of the result by comparing the result with the actual measured value by substituting it back into the model to ensure that the calculated absorption coefficient accurately reflects the internal situation of the fruit.
[0090] Specifically, the values of each target optical property parameter.
[0091]
[0092] where: μ a is the absorption coefficient, and μ′ s is the reduced scattering coefficient.
[0093] S14. Use the target optical property data as the input parameters for Monte Carlo simulation for simulation analysis to obtain the light propagation characteristics inside the fruit;
[0094] S14 includes the following steps:
[0095] S141. Initialize the Monte Carlo simulation parameters, and set the initial state of photons and the parameters of each layer of the fruit tissue;
[0096] Set the basic parameters of the Monte Carlo simulation according to the above target optical property data. Regard the fruit as a multi-layer structure, and determine the parameters such as the thickness, refractive index, absorption coefficient, scattering coefficient, and anisotropy factor of each layer. Initialize the initial weight of photons, determine the initial position and direction of photons, and set the initial incident direction as (μ x , μ y , μ z ) = (0, 0, 1). The initial position of two-dimensional simulation is (x, y, z) = (0, 0, 0), and the incident position coordinates (x, y, z) of three-dimensional simulation are determined according to the actual situation. If the emission point is outside the tissue surface, move the photon to the tissue surface as the emission starting point according to certain rules first.
[0097] S142. Calculate the step length, weight, and scattering direction by simulating the propagation of photons in the fruit tissue;
[0098] During the propagation of photons, the distance between two adjacent positions is the step length s. After each step length movement of the photon, the absorbed intensity is:
[0099] Δw = w(1 - exp(-μ α (v)·s))
[0100] where: Δw is the absorbed intensity of the photon, w is the current weight of the photon, and μ α (v) is the absorption coefficient of the tissue at the current position.
[0101] is the absorption coefficient of the tissue at the current position. Subtract this absorbed intensity from the original weight value to get the updated weight of the photon. The weight of the photon packet should be updated in time after each collision of the photon with the tissue to reach a new position.
[0102] After the photon migrates to a new position, scattering will occur, which is described by the deflection angle θ ∈ [0, π] and the azimuth angle ψ ∈ [0, 2π]. The calculation expressions for the scattering direction include:
[0103]
[0104] ψ = 2πδ
[0105] where: p(cosθ) is the probability distribution of the cosine of the deflection angle cosθ, g is the anisotropy factor, which reflects the directionality of photon scattering, g ∈ [-1, 1], θ is the deflection angle of photon scattering, θ ∈ [0, π]; cos(θ) is the cosine value of the deflection angle, δ is a random coefficient used to determine cosθ; ψ is the azimuth angle, ψ ∈ [0, 2π].
[0106] In the above formula, when g = 0, it indicates isotropy, that is, the probability of photons scattering in all directions is the same. When g = 1, it indicates complete forward scattering, and when g = -1, it indicates complete backward scattering.
[0107] The new direction of the photon is:
[0108]
[0109] In theory, after the step length and direction of the photon are determined, the coordinates of the next position of the photon can be determined. However, in fact, the next position of the photon is uncertain, that is, the next position of the photon may be in the current layer of tissue, or it may pass through the boundary of two adjacent layers of tissue to reach the next layer of tissue, or it may overflow outside the fruit tissue, such as in the case of apples, that is, in the air layer. Therefore, before each photon moves from the current position to the next position, it is necessary to first determine whether the photon encounters the tissue boundary or overflows. If not, that is, the next position of the photon is still in the current layer of tissue, the photon can be directly jumped to the next position, and the position and weight of the photon can be updated. If the position to which the photon reaches next is not in the current layer of tissue, it is necessary to first determine whether the photon encounters the interface of the two layers of tissue or overflows the tissue. If the photon is about to overflow to the surface of the tissue or is already on the surface of the tissue, the photon should be set to a dead state, stop tracking it, and then record its position, direction, weight and other information. If the photon hits the tissue boundary, it is processed according to the method of crossing the boundary, and then the direction, weight and position changes caused by the collision with the boundary are updated.
[0110] S143. Process reflection and transmission according to boundary conditions and update the photon position;
[0111] 1. When the photon encounters the tissue interface before moving, the incident angle and refraction angle of the photon when passing through the tissue boundary are calculated according to the refractive index distribution of the tissues on both sides of the boundary;
[0112] 2. Calculate the moving direction of the photon when it is reflected or when it is transmitted based on the reflection coefficient;
[0113] 3. Update the photon position according to the photon's step size and moving direction.
[0114] Based on the above steps, each time a photon moves, it is determined whether it encounters a tissue boundary or overflows. If it encounters a tissue interface, assuming that the refractive index distribution of the tissues on both sides of the boundary is n1 and n2, the incident angle of the photon when it passes through the tissue boundary is θ′, and the refraction angle is θ′ t . The calculation formula for the angle of incidence and the angle of refraction is:
[0115]
[0116] where: cosθ′ and cosθ′ t are the cosine values of the incident angle and the refraction angle of the photon respectively, and (a, b, c) is the normal vector of the tissue boundary. μ x , μ y , μ z are the components of the current propagation direction of the photon, n1 is the refractive index of the tissue at the current position of the photon, and n2 is the refractive index of the tissue to which the photon will move to the next position.
[0117] (a, b, c) is the normal vector of the tissue boundary, which can be calculated from the current position and the next position. Assume that the coordinates of the current position are (a, b, c), and the grid where the current position is located is:
[0118]
[0119] The next position to move to is (x1, y1, z1), and the grid where it is located is:
[0120] Let
[0121] To determine whether the photon is reflected or transmitted according to the Fresnel formula, first define a reflection coefficient r0. If cosθ′ = 1, that is, the photon is perpendicularly incident on the tissue boundary:
[0122]
[0123] If cosθ′ = 0, that is, the incident angle is 90 degrees, the photon moves along a direction parallel to the boundary and will not collide with the tissue boundary, and r0 = 0.
[0124] If n2 < n1, the photon will undergo total reflection:
[0125]
[0126] The calculation formula for the moving direction when the photon is reflected:
[0127]
[0128] where: μ′ x1 , μ′ y1 , μ′ z1 are the components of the propagation direction of the photon after reflection, and μ x1 , μ y1 , μ z1 are the components of the propagation direction of the photon before reflection;
[0129] The calculation formula for the moving direction when the photon is transmitted:
[0130]
[0131] Where: μ′ x2 , μ′ y2 , μ′ z2 is the component of the propagation direction of the reflected photon, and μ x2 , μ y2 , μ z2 is the component of the propagation direction of the photon before reflection;
[0132] Photon position update formula:
[0133]
[0134] Where: x, y, z are the position coordinates of the photon after update.
[0135] S144. After statistically processing the photon behavior data, obtain the absorption rate, diffuse reflectance, and diffuse transmittance of light inside the fruit.
[0136] Simulate the propagation process of a large number of photons, record the energy loss, reflection, and transmission of photons at different positions in the tissue. The weight lost in the [iz][ir] grid is recorded in A[iz][ir], and the energies of the transmitted and reflected photons are also recorded using corresponding matrices. Statistically process the recorded data to obtain the propagation characteristic data of light inside the fruit, such as the absorption rate, diffuse reflectance, and diffuse transmittance of photons.
[0137] S15. Based on the comparative analysis of the light propagation simulation data and the preset quality evaluation threshold, determine whether there are optical abnormal regions inside the fruit;
[0138] Obtain various characteristic data of light propagation simulations such as Monte Carlo simulations, including the propagation process of light inside the fruit. Determine the preset quality evaluation threshold, which is determined based on the optical characteristic data of a large number of normal fruit samples combined with the fruit quality evaluation criteria. The threshold covers the normal ranges of various optical characteristic indicators, such as the upper and lower limits of the light intensity at a specific wavelength, the reasonable interval of the absorption rate, etc. Compare each optical characteristic indicator in the light propagation simulation data with the preset quality evaluation threshold one by one. For the light intensity data at different positions, determine whether it is within the preset light intensity threshold range; for indicators such as the absorption rate and scattering rate, compare the actual data with the threshold.
[0139] If the optical characteristic indicators at one or more positions in the light propagation simulation data exceed the preset quality evaluation threshold range, it can be determined that there is an optical abnormal region at that position. Record the position information of the abnormal region and the corresponding abnormal optical characteristic indicators to provide a basis for subsequent analysis. If the light intensity in a certain region is significantly lower than the normal threshold and the absorption rate exceeds the normal range, it can be preliminarily determined that this region is an optical abnormal region.
[0140] S16. If there is an optical abnormal area, corresponding defect type, three-dimensional positioning coordinates and defect level parameters are output according to the deviation degree of the optical characteristics of the abnormal area and the spatial position information.
[0141] For the case where there is an optical abnormal area, calculate the differences or ratios between abnormal indexes such as light intensity, absorption rate, and scattering rate and the normal thresholds to quantify the deviation degree. For the area with abnormally reduced light intensity, calculate the percentage of the difference between its light intensity and the normal light intensity in the normal light intensity; for the area with abnormally increased absorption rate, analyze the multiple by which it exceeds the normal absorption rate.
[0142] Determine the defect type of the abnormal area according to the deviation degree of the optical characteristics and the optical characteristic patterns corresponding to different defect types. If the light intensity of a certain area drops sharply and the absorption rate rises significantly, which is consistent with the optical change characteristics caused by internal bruising of the fruit, then determine that the defect type of this area is bruising; if the change of the optical characteristics conforms to the tissue lesion characteristics caused by fungal infection, such as a specific change pattern of the scattering rate, then judge it as a fungal infection defect.
[0143] Based on the spatial position information of the abnormal area recorded in the light propagation simulation data and combined with the three-dimensional model of the fruit, determine the three-dimensional positioning coordinates of the abnormal area inside the fruit. Match the position information in the simulation data with the actual size and shape of the fruit, calculate the specific position of the abnormal area inside the fruit, and represent it in the form of coordinates such as the depth from the fruit skin and the orientation relative to the fruit core.
[0144] Evaluate the defect level parameters according to the deviation degree of the optical characteristics and the defect type. For the case where the deviation from the normal optical characteristics is mild and the defect area is small, it is determined as a mild defect level; when the optical characteristics deviate severely and the defect area is large, it is rated as a severe defect level; and the intermediate is a moderate defect level.
[0145] The above steps judge the optical abnormal area inside the fruit by comparing the light propagation simulation data with the preset threshold, and then determine the defect-related information according to the characteristics of the abnormal area, which can realize the accurate detection and evaluation of the defects inside the fruit and help to timely discover the fruit quality problems.
[0146] Those of ordinary skill in the art can realize that the units of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.
[0147] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored, etc. In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0148] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.
[0149] It can be understood that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of each embodiment of the present invention, and they should all be covered by the scope of the claims and the description of the present invention.
Claims
1. A method for detecting internal quality defects of fruits based on spatially resolved spectroscopy, characterized in that: include: A continuous wave light beam with preset parameters is used to vertically illuminate the surface of the fruit sample, and a light detector is used to collect reflected light signals at different spatial positions from the light source, and the spatially resolved reflectance distribution of the fruit at multiple wavelengths is calculated based on the reflected light signals; Performing nonlinear fitting inversion on the spatially resolved reflectance distribution at the multiple wavelengths to extract the relationship between the reduced scattering coefficient of the internal tissue of the fruit and the wavelength; Determining a set of optical characteristic parameters of target pulp tissue according to the mapping model between the reduced scattering coefficient and the optical characteristic of pulp tissue; Inputting the optical characteristic parameter set into a Monte Carlo light transmission model, simulating the propagation path and energy distribution characteristics of light of different wavelengths inside the fruit, and generating light propagation simulation data; Based on the comparative analysis of the light propagation simulation data and the preset quality assessment threshold, determining whether there is an optical abnormal area inside the fruit; If there is an optical abnormal area, the corresponding defect type, three-dimensional positioning coordinates and defect level parameters are output according to the degree of deviation of the optical characteristics and spatial position information of the abnormal area.
2. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 1, characterized in that: The nonlinear fitting inversion is performed on the spatially resolved reflectance distribution at the multiple wavelengths to extract the relationship between the reduced scattering coefficient of the internal tissue of the fruit and the wavelength, including: Obtain the initial absorption coefficient inside the fruit sample; Set the fitting coefficients and intermediate variables in the fitting formula, and use the set fitting formula to calculate the corresponding reduced scattering coefficient; Calculating the predicted reflectivity of the diffusion model at different distances based on the calculated reduced scattering coefficient and the initial absorption coefficient; The reduced scattering coefficient inside the fruit is determined by adjusting the error between the spatially resolved reflectance and the predicted reflectance.
3. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 2, wherein: The step of calculating the predicted reflectivity of the diffusion model at different distances using the calculated reduced scattering coefficient and the initial absorption coefficient comprises: The expression of the diffusion model is: Where: R(r) is the reflectivity at a distance r from the light source, r is the source-detector distance, D is the diffusion coefficient, r1 and r2 are coefficients related to the source-detector distance r, μ eff is the effective attenuation coefficient, μ′ eff is a parameter related to the effective attenuation coefficient, C1 and C2 are constants, μ′ t is the total attenuation coefficient, z b are parameters related to the sample boundary conditions or geometry.
4. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 2, wherein: The step of determining the reduced scattering coefficient inside the fruit by adjusting the error between the spatially resolved reflectivity and the predicted reflectivity comprises: Calculating the error between the spatially resolved reflectivity and the predicted reflectivity using a least squares method; The fitting coefficient and the intermediate variable are adjusted according to the calculated error, and the adjusted fitting coefficient and the intermediate variable are substituted into the fitting formula to obtain a new reduced scattering coefficient; The new predicted reflectance is calculated based on the diffusion model, the error is recalculated, and the reduced scattering coefficient when the error is minimized is determined as the reduced scattering coefficient inside the fruit.
5. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 1, characterized in that: Determining a set of optical characteristic parameters of target pulp tissue according to the mapping model between the reduced scattering coefficient and the optical characteristic of pulp tissue includes: calculating the absorption coefficient inside the fruit according to the reduced scattering coefficient inside the fruit; The target optical property data of the pulp tissue inside the fruit is calculated based on the reduced scattering coefficient and absorption coefficient inside the fruit.
6. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 1, characterized in that: The optical characteristic parameter set is input into the Monte Carlo light transmission model to simulate the propagation path and energy distribution characteristics of light of different wavelengths inside the fruit, and generate light propagation simulation data, including: Initialize the Monte Carlo simulation parameters and set the initial state of photons and parameters of each layer of fruit tissue; The step size, weight and scattering direction are calculated by simulating the propagation of photons in fruit tissue; Process reflection and transmission according to boundary conditions and update the photon position; The statistical photon behavior data are standardized to obtain the light absorption rate, diffuse reflectance and diffuse transmittance inside the fruit.
7. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 6, characterized in that: The step length, weight and scattering direction are calculated by simulating the propagation of photons in fruit tissue, including: Expressions for calculating step size and weight: Δw=w(1―exp(―μ α (v)·s)) Where: Δw is the absorption intensity of the photon, w is the current weight of the photon, μ α (v) is the absorption coefficient of the tissue at the current position, and s is the step size of the photons; Scattering direction calculation formula: ψ=2πδ Where: p(cosθ) is the probability distribution of the cosine of the deflection angle cosθ, g is the anisotropy factor, reflecting the directionality of photon scattering, g∈[―1,1], θ is the deflection angle of photon scattering, θ∈[0,π]; cos(θ) is the cosine value of the deflection angle, δ is a random coefficient used to determine cosθ; ψ is the azimuth, ψ∈[0,2π].
8. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 6, characterized in that: Processing reflection and transmission according to boundary conditions and updating the photon position includes: When the photon encounters a tissue interface before moving, the incident angle and refraction angle of the photon when passing through the tissue boundary are calculated based on the refractive index distribution of the tissues on both sides of the boundary; Based on the reflection coefficient, the moving direction of the photon when it is reflected or the moving direction of the photon when it is transmitted is calculated respectively; Update the photon position according to the photon's step size and moving direction.
9. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 8, characterized in that: Processing reflection and transmission according to boundary conditions and updating the photon position includes: The calculation formula for the angle of incidence and the angle of refraction is: Among them: cosθ′ and cosθ′ t are the cosine values of the photon incident angle and photon refraction angle, respectively, (a, b, c) is the normal vector of the tissue boundary, μ x ,μ y ,μ z is the component of the current propagation direction of the photon, n1 is the refractive index of the tissue at the current location of the photon, and n2 is the refractive index of the tissue at the next location where the photon will move; The formula for calculating the direction of movement of a photon when it is reflected is: Where: μ′ x1 ,μ′ y1 ,μ′ z1 is the component of the propagation direction of the photon after reflection, μ x1 ,μ y1 ,μ z1 is the component of the photon propagation direction before reflection; The formula for calculating the direction of movement of photons when they are transmitted is: Where: μ′ x2 ,μ′ y2 ,μ′ z2 is the component of the propagation direction of the photon after reflection, μ x2 ,μ y2 ,μ z2 is the component of the photon propagation direction before reflection; Photon position update formula: Among them: x, y, z are the updated position coordinates of the photon.
10. The method for detecting internal quality defects of fruits based on spatially resolved spectroscopy according to claim 9, characterized in that: If there is an optical abnormal area, the corresponding defect type, three-dimensional positioning coordinates and defect level parameters are output according to the optical characteristic deviation degree and spatial position information of the abnormal area, including: When all evaluation indicators in the simulation results are within the preset normal range, the defect type is determined based on the matching degree between the change characteristics of the light propagation characteristic index data inside the fruit obtained by Monte Carlo simulation and the light propagation characteristic patterns corresponding to different defect types; The defect location is determined based on the corresponding position of the area where the light propagation is abnormal in the Monte Carlo simulation in the fruit geometric model, combined with the spatial coordinate information of the change in the light propagation characteristics in the simulation data; The severity of the defect is determined by the size of the defect area and the extent to which the defect area affects the light propagation characteristics.
Citation Information
Cited By
Near-infrared detection method and probe device for internal quality of fresh corn ears
CN120609780A
