Milk product quality detection method and system based on spectral analysis

By modulating the light source and the reference optical path to generate a corrected spectrum, and combining an integrating sphere and a ring multi-angle detector array, a scattering compensation factor is constructed, which solves the problems of scattering interference and light source drift in the spectral detection of dairy products, and realizes the accurate detection of the content of dairy product components.

CN121027015AActive Publication Date: 2025-11-28SCI & TECH SUPPORT CENT SICHUAN ACAD OF AGRI SCI

Patent Information

Application Number
CN202511537855.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2025-11-28
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

Existing methods for spectral detection of dairy products suffer from problems such as scattering interference leading to distortion of absorption characteristics and insufficient stability due to light source drift and environmental conditions.

Method used

A rectified spectrum is generated using a modulated light source and a reference optical path. By combining an integrating sphere and a ring multi-angle detector array, a scattering compensation factor is constructed. Through joint analysis of scattering distribution and total transmittance spectrum, the scattering contribution is separated to obtain the effective absorption spectrum, which is then input into the component calculation model to output the target component content.

Benefits of technology

It improves the accuracy and batch-to-batch consistency of dairy product testing results, effectively offsets light source intensity drift and environmental interference, avoids optical path deviation caused by single-angle measurement, and achieves comprehensive characterization of strongly scattering emulsion systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121027015A_ABST
    Figure CN121027015A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a dairy product quality detection method and system based on spectral analysis, and belongs to the technical field of optical detection. The method comprises the following steps: introducing a dairy product sample to be detected into a constant-temperature colorimetric pool, emitting incident light by utilizing a modulated light source, and simultaneously collecting original spectral signals in a sample channel and a reference channel; generating a correction spectrum based on the original spectrum signal, and inputting the correction spectrum into an integrating sphere to collect omni-directional transmission light to obtain a total transmission spectrum; scattering distribution data at different angles are obtained based on an annular multi-angle detector array arranged on the outer wall of the constant-temperature colorimetric pool; constructing a scattering compensation factor based on the scattering distribution data and the total transmission spectrum, and acting the scattering compensation factor on the total transmission spectrum to obtain an effective absorption spectrum; and inputting the effective absorption spectrum into a composition calculation model, and outputting the content of each target component of the dairy product to be detected. According to the scheme, rapid, lossless and high-precision detection of the key component content of the dairy product is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of optical detection technology, and more specifically to a method and system for detecting the quality of dairy products based on spectral analysis. Background Technology

[0002] Dairy products, as a typical emulsion system, contain various components such as proteins, fats, and lactose, along with a large number of colloidal particles and fat droplets. For the quality inspection of such complex systems, spectroscopic analysis methods are widely used for dairy product component detection and quality control due to their advantages of speed, non-destructive nature, and parallel measurement of multiple parameters. However, existing spectroscopic detection methods still face several technical bottlenecks in the dairy product context, directly affecting the accuracy and stability of the detection results.

[0003] The strong light scattering effect of dairy products can severely interfere with spectral signals. Due to the uneven size distribution of fat globules and protein particles in emulsions, incident light undergoes extensive scattering within the sample, leading to baseline shifts and distortions in absorption characteristics in the transmission spectrum. Existing techniques typically employ mathematical preprocessing methods such as multivariate scattering correction (MSC) or standard normal variable transformation (SNV) to mitigate the effects of scattering. However, these methods rely on empirical modeling, are easily affected by batch-to-batch variations in samples, and exhibit significantly reduced correction effectiveness when dairy product formulations vary considerably or the emulsion state is unstable.

[0004] The stability of the light source and changes in environmental conditions during the testing process can also introduce errors. Dairy product testing often requires a specific temperature. If the temperature control of the colorimetric cell is unstable, it can cause milk fat crystallization or phase changes, further exacerbating the scattering effect. Simultaneously, drift in light source intensity or interference from ambient light directly affects the spectral reference, leading to significant deviations in results for the same sample across different testing batches. Existing methods largely rely on periodic calibration using external standard samples, failing to provide real-time correction for drift during testing, thus making it difficult to guarantee the reliability of long-term continuous testing.

[0005] In summary, existing spectral detection methods for dairy products generally suffer from insufficient handling of scattering interference and excessive dependence on the stability of light sources and the environment. These problems result in significant deficiencies in the accuracy and batch-to-batch consistency of the detection results. Summary of the Invention

[0006] The purpose of this invention is to provide a method and system for quality testing of dairy products based on spectral analysis, so as to at least solve the problems of distortion of absorption characteristics caused by scattering interference in existing spectral testing of dairy products and insufficient stability of the testing process due to light source drift and environmental conditions.

[0007] To achieve the above objectives, the first aspect of the present invention provides a method for quality testing of dairy products based on spectral analysis. The method includes: introducing a dairy product sample to be tested into a constant-temperature colorimetric cell, emitting incident light using a modulated light source, and simultaneously acquiring raw spectral signals in the sample channel and the reference channel; generating a correction spectrum based on the raw spectral signals, and inputting the correction spectrum into an integrating sphere to collect omnidirectional transmitted light to obtain a total transmission spectrum; acquiring scattering distribution data at different angles based on a ring-shaped multi-angle detector array deployed on the outer wall of the constant-temperature colorimetric cell; constructing a scattering compensation factor based on the scattering distribution data and the total transmission spectrum, and applying the scattering compensation factor to the total transmission spectrum to obtain an effective absorption spectrum; inputting the effective absorption spectrum into a component calculation model to output the content of each target component in the dairy product to be tested.

[0008] Optionally, the modulated light source is a multi-band LED array, with each band emitting incident light according to a preset pulse frequency; emitting incident light using the modulated light source includes: sequentially lighting each band of the multi-band LED array in each sampling period to obtain incident light covering a preset wavelength range; pulse-modulating the emission timing of each band of the light source during the lighting process to make the incident light exhibit modulation characteristics corresponding to the preset pulse frequency in the time domain; and outputting an incident light sequence covering the preset wavelength range and having pulse modulation characteristics upon completion of one sampling period.

[0009] Optionally, the sample channel is located on the light-emitting side of the constant-temperature colorimetric cell and is used to collect the spectral signal of the dairy product sample after transmission under the action of incident light; the reference channel is set as an optical path parallel to the constant-temperature colorimetric cell and is used to collect the spectral signal of the dairy product sample that has not passed through it, so as to serve as a reference for generating the calibration spectrum.

[0010] Optionally, the original spectral signals are acquired simultaneously in the sample channel and the reference channel, including: during the process of the incident light sequence irradiating the colorimetric cell, detecting the spectral signal after passing through the dairy product sample in the sample channel and generating the original spectrum of the sample channel; during the process of the incident light sequence irradiating the reference path, detecting the spectral signal that does not pass through the dairy product sample in the reference channel and generating the original spectrum of the reference channel; storing the original spectrum of the sample channel and the original spectrum of the reference channel respectively, and using them as the original spectral signals.

[0011] Optionally, generating a corrected spectrum based on the original spectral signal includes: performing intensity normalization processing on the original spectral signal of the reference channel to obtain the emission reference of the light source in the current sampling period; calculating the ratio of the original spectral signal of the sample channel to the emission reference band by band to obtain an intermediate spectrum that has eliminated the influence of light source intensity drift; performing dark current subtraction and baseline smoothing operations on the intermediate spectrum to output the corrected spectrum.

[0012] Optionally, the calibration spectrum is input into the integrating sphere to collect omnidirectional transmitted light to obtain the total transmission spectrum. This includes: introducing the calibration spectrum into the inlet of the integrating sphere through the outlet of the colorimeter cell, and limiting the inlet diameter of the integrating sphere to a preset ratio with the reflectivity of its inner wall to ensure that incident light from different angles is collected; after multiple diffuse reflections on the inner surface of the integrating sphere, the transmitted light from each angle is combined into a uniform light field distribution by utilizing the optical path homogenization effect inside the sphere; and performing luminous flux integration on the uniform light field distribution to obtain the total transmission spectrum.

[0013] Optionally, based on acquiring scattering distribution data at different angles by deploying a ring-shaped multi-angle detector array on the outer wall of the constant temperature colorimetric cell, the method includes: setting multiple light-collecting windows at preset angle intervals on the outer wall of the constant temperature colorimetric cell so that the scattered light passing through the dairy product sample exits at different angles; sequentially acquiring the scattering intensity value at each light-collecting window at the corresponding angle, and arranging the scattering intensity values ​​according to the acquisition order to form an angular intensity sequence; normalizing the angular intensity sequence to eliminate the influence of path length differences at different angles, and outputting scattering distribution data.

[0014] Optionally, a scattering compensation factor is constructed based on the scattering distribution data and the total transmission spectrum, and the scattering compensation factor is applied to the total transmission spectrum to obtain an effective absorption spectrum. This includes: inputting the scattering distribution data and the total transmission spectrum into a Mie scattering inversion operation with finite angle sampling according to the band correspondence, calculating the equivalent particle size distribution parameters and effective scattering coefficients in each band; generating a compensation matrix based on the equivalent particle size distribution parameters and effective scattering coefficients, and storing the compensation matrix as a scattering compensation factor; and calling the scattering compensation factor to perform scattering subtraction operation on the total transmission spectrum band by band, outputting the effective absorption spectrum.

[0015] Optionally, the effective absorption spectrum is input into the component calculation model to output the content of each target component of the dairy product to be tested, including: dividing the effective absorption spectrum into multiple characteristic intervals according to the wavelength, and using the absorption intensity of each characteristic interval as an input variable; calling the regression equation corresponding to the target component in the component calculation model to perform quantitative calculation on each target component; wherein, each target component is fat, protein and / or lactose; after completing the quantitative calculation, the content of each target component is output, and the content result is stored together with the corresponding effective absorption spectrum.

[0016] A second aspect of the present invention provides a dairy product quality testing system based on spectral analysis. The system includes: a first acquisition unit for introducing a dairy product sample to be tested into a constant-temperature colorimetric cell, emitting incident light using a modulated light source, and simultaneously acquiring original spectral signals in the sample channel and the reference channel; a correction unit for generating a correction spectrum based on the original spectral signals, and inputting the correction spectrum into an integrating sphere to collect omnidirectional transmitted light to obtain a total transmission spectrum; a second acquisition unit for acquiring scattering distribution data at different angles based on a ring-shaped multi-angle detector array deployed on the outer wall of the constant-temperature colorimetric cell; a compensation unit for constructing a scattering compensation factor based on the scattering distribution data and the total transmission spectrum, and applying the scattering compensation factor to the total transmission spectrum to obtain an effective absorption spectrum; and an output unit for inputting the effective absorption spectrum into a component calculation model and outputting the content of each target component in the dairy product to be tested.

[0017] The above technical solution stabilizes the detection environment in a constant-temperature colorimetric cell and generates a correction spectrum using a modulated light source and a reference optical path, effectively offsetting light source intensity drift and environmental interference. Furthermore, an integrating sphere is used to acquire omnidirectional transmitted light, avoiding optical path deviation caused by single-angle measurements. A ring-shaped multi-angle detection array is then employed to obtain the scattering distribution, thus achieving a comprehensive characterization of strongly scattering emulsion systems. By constructing a scattering compensation factor through joint analysis of the scattering distribution and total transmittance spectrum, scattering contributions can be separated at the spectral level, yielding an effective absorption spectrum that more closely approximates the true absorption characteristics. Finally, the effective absorption spectrum is input into the component calculation model, accurately outputting the content of target components such as fat, protein, and lactose in dairy products, thereby improving the accuracy of detection results and batch-to-batch consistency.

[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0019] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the steps of a dairy product quality detection method based on spectral analysis provided by one embodiment of the present invention; Figure 2 This is a system structure diagram of a dairy product quality testing system based on spectral analysis provided in one embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0021] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0022] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0023] Figure 1 This is a flowchart illustrating the steps of a dairy product quality testing method based on spectral analysis, provided by one embodiment of the present invention. Figure 1 As shown, this invention provides a method for quality detection of dairy products based on spectral analysis, the method comprising: Step S1: Introduce the dairy product sample to be tested into the constant temperature colorimetric cell, use a modulated light source to emit incident light, and simultaneously collect the original spectral signals in the sample channel and the reference channel.

[0024] Specifically, the modulated light source is a multi-band LED array, with each band emitting incident light at a preset pulse frequency. Emitting incident light using the modulated light source includes: sequentially lighting each band of the multi-band LED array in each sampling period to obtain incident light covering a preset wavelength range; pulse-modulating the emission timing of each band of the light source during the lighting process to make the incident light exhibit modulation characteristics corresponding to the preset pulse frequency in the time domain; and outputting an incident light sequence covering the preset wavelength range and having pulse modulation characteristics upon completion of one sampling period.

[0025] Furthermore, the sample channel is located on the light-emitting side of the constant-temperature colorimetric cell and is used to collect the spectral signal of the dairy product sample after transmission under the action of incident light; the reference channel is set as an optical path parallel to the constant-temperature colorimetric cell and is used to collect the spectral signal of the dairy product sample that has not passed through it, so as to serve as a reference for generating the calibration spectrum.

[0026] In this embodiment of the invention, the original spectral signals are simultaneously acquired in the sample channel and the reference channel, including: during the process of the incident light sequence irradiating the colorimetric cell, detecting the spectral signal after passing through the dairy product sample in the sample channel and generating the original spectrum of the sample channel; during the process of the incident light sequence irradiating the reference path, detecting the spectral signal that does not pass through the dairy product sample in the reference channel and generating the original spectrum of the reference channel; storing the original spectrum of the sample channel and the original spectrum of the reference channel respectively, and using them as the original spectral signals.

[0027] In this embodiment of the invention, the dairy product sample to be tested needs to be introduced into a constant-temperature colorimetric cell. A constant-temperature colorimetric cell is a liquid sample container used for spectral detection, with a regular optical transmission path inside. It is made of quartz or high-transmittance glass, possessing strong optical transparency to avoid excessive absorption or scattering of incident light across multiple wavelengths. A constant-temperature jacket surrounds the outer wall of the colorimetric cell. A temperature-regulating liquid can be circulated within the jacket, or the temperature can be controlled by a semiconductor cooling chip to maintain the internal temperature of the colorimetric cell within a stable range. This design is because dairy products are emulsions containing numerous fat globules and protein particles. Unstable temperatures can cause phase transitions or aggregation of the fat components, directly altering the scattering state and leading to significant shifts in the spectral curve. Therefore, the constant-temperature colorimetric cell serves not only as a sample container but, more importantly, as a detection chamber providing a thermally uniform environment and stable optical path.

[0028] After the dairy product samples are injected into the isothermal colorimetric cell, the next step is to illuminate the samples with incident light emitted from a modulated light source. This modulated light source is specifically a multi-band LED array. The emission wavelengths of each LED in the array can cover the key range from visible light to near-infrared, such as 450nm, 620nm, 850nm, and 1300nm. These bands correspond to the characteristic absorption ranges of fat, protein, and lactose in dairy products, respectively. To ensure signal quality, each LED band is not continuously lit but driven according to a preset pulse frequency. The purpose of this is to give the incident light a specific frequency label through time-domain modulation, allowing the true signal to be separated from ambient light interference and electrical noise during subsequent signal processing using phase-locked demodulation.

[0029] More specifically, emitting incident light using a modulated light source includes the following steps: Within each sampling period, each wavelength band of the LED array is sequentially illuminated, with each band emitting light according to a set time slot. For example, if a sampling period is set to several milliseconds, a 450nm wavelength LED can be illuminated in the first time slot, a 620nm wavelength LED in the second time slot, and so on, until all preset wavelength bands are sequentially illuminated and a cycle is completed. During the illumination process, the driving current of each LED is modulated according to a preset pulse frequency, such as 1kHz or higher. This results in the output light exhibiting a distinct pulse characteristic in the time domain. Those skilled in the art can understand this as different wavelength bands each carrying a modulation frequency label. At the end of a sampling period, an incident light sequence covering the preset wavelength range and exhibiting pulse modulation characteristics is obtained. This incident light sequence enters a constant-temperature colorimetric cell, where the sample is excited and transmitted band by band.

[0030] In the optical path design of the colorimetric cell, two acquisition channels are set up: a sample channel and a reference channel. The sample channel is positioned on the light-emitting side of the colorimetric cell, meaning that the incident light passes through the dairy product sample and directly illuminates the detection optical path corresponding to this channel. With this arrangement, the signal acquired by the sample channel fully reflects the transmission spectral characteristics of the dairy product under the action of incident light. Correspondingly, the reference channel is set as an optical path parallel to the colorimetric cell; it does not pass through the dairy product sample but directly outputs a portion of the light from the light source to the detector. The main function of the reference channel is to provide the output reference of the light source itself, so as to subsequently correct the data from the sample channel. Thus, the reference channel and the sample channel form a complementary relationship: the former reflects the original characteristics of the light source, and the latter reflects the transmission characteristics of the sample. By comparing the two, the influence of non-sample factors such as light source intensity drift and environmental interference can be eliminated.

[0031] During the process, raw spectral signals are simultaneously acquired in both the sample channel and the reference channel. Specifically, when the incident light sequence illuminates the colorimetric cell, after the light in the dairy sample is absorbed and scattered, some transmitted light still reaches the outlet of the colorimetric cell. The sample channel detects the transmitted light and records the intensity-wavelength curve, which is the raw spectrum of the sample channel. At the same time, the reference channel synchronously receives the light signal from the light source branch and records the corresponding wavelength-intensity curve, obtaining the raw spectrum of the reference channel. Since both acquisitions are performed synchronously and use the same incident light sequence, each wavelength band has corresponding raw spectral data in both the sample channel and the reference channel.

[0032] Furthermore, the original spectra of the sample channel and the original spectra of the reference channel are stored separately and used as input data for subsequent calibration spectrum generation. The significance of the original spectrum of the sample channel lies in its inclusion of the true information about the effect of light on the dairy sample, including absorption characteristics and scattering effects; the original spectrum of the reference channel serves as a benchmark, helping to eliminate fluctuations in light source intensity and environmental factors. By combining the two, a more stable and accurate calibration spectrum can be obtained. This step is crucial in the entire spectral analysis process because without reference data, the sample data will be directly affected by light source drift, thus reducing detection accuracy; conversely, without sample data, information about the dairy product composition cannot be obtained. Therefore, the sample channel and the reference channel must exist in pairs and remain synchronized during each acquisition to ensure the reliability of subsequent analysis.

[0033] It is worth emphasizing that the structure of the isothermal cuvette is crucial for ensuring the stability of the acquired signal. In dairy product testing, temperature fluctuations can cause partial coagulation of milk fat or aggregation of proteins. These phenomena can drastically change the scattering behavior of light in the sample, resulting in significant differences in the spectral curve between different detection periods. By setting up an isothermal jacket, the sample inside the cuvette is kept at a stable temperature, which can greatly reduce the impact of such physical changes. Furthermore, the optical path length of the isothermal cuvette is typically between 5 mm and 20 mm, and can be adjusted according to the turbidity of the dairy product. Too short a path length will result in indistinct signal characteristics, while too long a path length may lead to complete loss of transmission signal. Operators can flexibly select the optical path length according to the type of dairy product (e.g., whole milk, low-fat milk, or yogurt).

[0034] Step S2: Generate a corrected spectrum based on the original spectral signal, and input the corrected spectrum into an integrating sphere to collect omnidirectional transmitted light to obtain the total transmission spectrum.

[0035] Specifically, generating a corrected spectrum based on the original spectral signal includes: performing intensity normalization processing on the original spectral signal of the reference channel to obtain the emission reference of the light source in the current sampling period; calculating the ratio of the original spectral signal of the sample channel to the emission reference band by band to obtain an intermediate spectrum that has eliminated the influence of light source intensity drift; performing dark current subtraction and baseline smoothing operations on the intermediate spectrum to output the corrected spectrum.

[0036] Furthermore, the calibration spectrum is input into the integrating sphere to collect omnidirectional transmitted light to obtain the total transmission spectrum. This includes: introducing the calibration spectrum into the inlet of the integrating sphere through the cuvette outlet, and limiting the inlet diameter of the integrating sphere to a preset ratio with the reflectivity of its inner wall to ensure that incident light from different angles is collected; after multiple diffuse reflections on the inner surface of the integrating sphere, the transmitted light from each angle is combined into a uniform light field distribution by utilizing the optical path equalization effect inside the sphere; and performing luminous flux integration on the uniform light field distribution to obtain the total transmission spectrum.

[0037] In this embodiment of the invention, after acquiring the raw spectral signals of the sample channel and the reference channel, the raw data needs to be further processed to generate a corrected spectrum. Based on this, an integrating sphere is used to collect omnidirectional transmitted light to obtain the total transmission spectrum. The reason for this two-step processing chain is that the raw spectral data often contains interference from fluctuations in the light source's output, noise caused by changes in environmental conditions, and inherent dark current in the detector. If used directly for subsequent analysis, this would mask or even distort the curves representing the true absorption characteristics of dairy products. Therefore, it is necessary to first eliminate these non-sample factors through operations such as reference correction, ratio calculation, and signal smoothing, and then collect the comprehensive transmitted light signal within the integrating sphere to ensure the accuracy and comparability of the final total transmission spectrum.

[0038] Furthermore, generating a corrected spectrum based on the original spectral signal includes the following steps. First, intensity normalization processing is performed on the original spectral signal of the reference channel. The purpose of this step is to obtain the emission reference of the light source in the current sampling period. Since dairy product testing often requires continuous acquisition, fluctuations in the light source output are inevitable. The existence of the reference channel can reflect the true output state of the light source in real time. By normalizing the reference signal, the influence of inconsistencies in light intensity between different sampling periods can be eliminated, making it a unified standard for subsequent comparisons.

[0039] Furthermore, the original spectral signal of the sample channel is compared with the emission reference band by band-by-band. Band-by-band ratio refers to dividing the intensity value of the sample channel by the normalized intensity value of the reference channel at each preset wavelength point. This eliminates common factors such as light source drift and changes in ambient light intensity, retaining only the sample's own absorption and scattering of light, thus obtaining a purer intermediate spectrum. This intermediate spectrum can be understood as the sample transmission curve recalibrated under the light source reference conditions, no longer affected by external unstable factors.

[0040] After obtaining the intermediate spectrum, dark current subtraction and baseline smoothing are required. Dark current is the output signal generated by the detector even in the absence of light input; if not subtracted, it will introduce background shift across the entire spectrum. Baseline drift, on the other hand, may originate from inhomogeneities in the detector response or the accumulation of electronic noise. By recording the dark current curve before spectral acquisition and then subtracting it point by point during processing, this background shift can be eliminated. Simultaneously, baseline smoothing using methods such as polynomial fitting or moving average can further suppress high-frequency noise, making the spectral curve smoother and more continuous. After the above processing, the final result is the corrected spectrum. Compared with the original spectrum, the corrected spectrum has removed interference from light source fluctuations, dark current, and baseline noise, and is closer to the true optical characteristics of the sample itself.

[0041] Furthermore, the corrected spectrum needs to be input into the integrating sphere to collect omnidirectional transmitted light, obtaining the total transmission spectrum. The details of this process are worth explaining. "Inputting the corrected spectrum" does not mean directly inputting numerical values, but rather that the corrected incident light sequence is irradiated onto the cuvette outlet and then enters the inlet of the integrating sphere. The integrating sphere is a spherical cavity whose inner wall is coated with a highly reflective diffuse reflective material, such as barium sulfate or polytetrafluoroethylene. Here, the inlet diameter of the integrating sphere and the reflectivity of its inner wall must meet a preset ratio. Typically, the inlet diameter should be much smaller than the sphere diameter to reduce direct light leakage, while the inner wall reflectivity must be greater than 90% to ensure that the incident light is not excessively absorbed after multiple reflections. This structural constraint ensures that light transmitted from different angles can be effectively collected.

[0042] After the calibrated spectrum enters the integrating sphere through the cuvette outlet, the light undergoes multiple diffuse reflections on the inner surface. Each reflection randomizes the direction of the light, gradually forming a uniformly distributed light field inside the integrating sphere. This can be understood as the light beam initially emitted from the cuvette outlet potentially being concentrated at certain angles, but after multiple scatterings and homogenization by the integrating sphere, a unified light field distribution independent of the incident direction is ultimately formed inside the cavity. This homogenization effect greatly eliminates the influence of angular differences on the measurement results.

[0043] Finally, luminous flux integration is performed on the uniform light field distribution to obtain the total transmission spectrum. The process of luminous flux integration essentially involves collecting and accumulating the light intensity uniformly distributed within the cavity point-by-point according to the spectral wavelength, resulting in a total value that includes the transmission contributions from all angles. The total transmission spectrum generated in this way provides a more comprehensive reflection of the light absorption of the dairy sample compared to transmission measurements at a single angle.

[0044] Step S3: Obtain scattering distribution data at different angles by deploying a ring-shaped multi-angle detector array on the outer wall of the constant temperature colorimetric cell.

[0045] Specifically, multiple light-collecting windows are set at preset angle intervals on the outer wall of the constant temperature colorimetric cell, so that the scattered light passing through the dairy product sample is emitted at different angles; the scattered intensity value at the corresponding angle is obtained sequentially at each light-collecting window, and the scattered intensity value is arranged according to the acquisition order to form an angular intensity sequence; the angular intensity sequence is normalized to eliminate the influence of the difference in path length at different angles, and the scattered distribution data is output.

[0046] In this embodiment of the invention, to accurately obtain the light scattering characteristics of dairy product samples, multiple light-collecting windows are provided on the outer wall of the constant-temperature colorimetric cell, and these windows are arranged at preset angular intervals. These "preset angular intervals" are not arbitrarily chosen, but rather planned based on the sensitive angles of particle size distribution according to Mie scattering theory. For example, several sampling angles, such as 15°, 30°, and 45°, are evenly divided between 0° and 180° to ensure coverage of small-angle, medium-angle, and large-angle scattering regions. The purpose of this arrangement is to obtain a sufficiently complete description of the scattering distribution curve with as few collection points as possible, balancing measurement efficiency and signal resolution.

[0047] When incident light passes through a dairy sample, some photons undergo elastic scattering due to the presence of fat globules and protein particles, exiting from different angles along the cuvette wall. Each light-collecting window receives this scattered light from different directions. By sequentially acquiring the scattering intensity values ​​at each light-collecting window, a set of intensity data corresponding one-to-one with each angle can be obtained. To ensure data reliability, the area, light-transmitting material, and optical lens parameters of each light-collecting window must be standardized so that the scattering intensities measured at different angles are comparable. Acquisition is typically set to angle-by-angle scanning or parallel acquisition, which can be selected by those skilled in the art based on experimental conditions.

[0048] After obtaining the scattering intensity values ​​at different angles, these data need to be arranged in the order of acquisition to form an angular intensity sequence. The significance of this sequence lies in its ability to directly characterize the scattering distribution of light by the sample, that is, the intensity distribution of photons in the spatial angular domain. Since the optical path lengths corresponding to different angles may differ—for example, small-angle scattered light typically has a shorter propagation path, while large-angle scattered light may undergo more internal reflections—directly comparing the intensities at different angles introduces the influence of path difference. To address this issue, the angular intensity sequence needs to be normalized. Normalization can be achieved by dividing the intensity value at each angle by the corresponding path correction factor, or by scaling all angular intensity values ​​to a unified reference scale using the constraint of overall energy conservation.

[0049] After normalization, the scattering distribution data can be output. This data includes the normalized scattering intensity at various preset angles, accurately reflecting the light scattering effect of the internal microparticle structure of the dairy sample. This data will be directly input into the subsequent scattering compensation factor construction process to invert the equivalent particle size distribution and scattering coefficient of the sample. Through this angular distribution acquisition and normalization process, this invention can obtain stable and repeatable scattering distribution results in complex emulsion systems, effectively supporting subsequent spectral compensation and component calculation.

[0050] Step S4: Construct a scattering compensation factor based on the scattering distribution data and the total transmission spectrum, and apply the scattering compensation factor to the total transmission spectrum to obtain an effective absorption spectrum.

[0051] Specifically, the scattering distribution data and the total transmission spectrum are input into the Mie scattering inversion operation with finite angle sampling according to the band correspondence, and the equivalent particle size distribution parameters and effective scattering coefficients under each band are calculated; a compensation matrix is ​​generated based on the equivalent particle size distribution parameters and effective scattering coefficients, and the compensation matrix is ​​stored as a scattering compensation factor; the scattering compensation factor is called to perform scattering subtraction operation on the total transmission spectrum band by band, and the effective absorption spectrum is output.

[0052] In this embodiment of the invention, to eliminate the interference of particulate scattering in dairy product samples on the spectral curve, after obtaining the scattering distribution data and total transmission spectrum, a scattering compensation factor needs to be constructed through mathematical modeling and applied to the total transmission spectrum to recover the effective absorption spectrum containing only the absorption effect. Since dairy products commonly contain fat globules and protein particles with a wide size distribution, and the refractive index of these particles differs from the surrounding medium, strong Mie scattering occurs under light irradiation. A characteristic of Mie scattering is that the angular distribution depends on the particle size and refractive index difference; therefore, there is a correspondence between the scattering distribution data at different angles and the intensity changes in each band of the spectrum.

[0053] Specifically, the scattering distribution data and the total transmission spectrum are input into the Mie scattering inversion operation with finite angle sampling according to their band correspondence. Mathematically, the angular function of the scattering intensity is first established based on Mie theory:

[0054] in, This represents the scattering intensity at an angle θ at a wavelength λ. Let be the incident light intensity; k be the wavenumber; and S1 and S2 be the scattering amplitude functions related to particle size and refractive index, respectively. By substituting the discrete values ​​of the sampling angle, the experimental scattering intensity curves for each waveband can be obtained. Then, using the least squares inversion method, the experimental scattering distribution is fitted to the theoretical scattering distribution to obtain the equivalent particle size distribution parameters for each waveband. With effective scattering coefficient The formula is expressed as:

[0055] Among them, I exp For the measured scattering intensity; I theo The scattering intensity is calculated based on Mie theory; D is the equivalent particle size distribution parameter at wavelength λ. The effective scattering coefficient is given. Through this optimization calculation, the equivalent particle size distribution and scattering coefficient in each waveband can be obtained.

[0056] Based on the equivalent particle size distribution parameters and effective scattering coefficient, a compensation matrix M(λ) is further generated, where each element represents the contribution of scattering to the transmission spectrum at a specific wavelength. Formally, this can be expressed as:

[0057] in, This is a functional relationship that maps particle size and scattering coefficient to a scattering correction factor. This compensation matrix is ​​the scattering compensation factor and is stored as the basis for subsequent calculations.

[0058] During the compensation phase, the scattering compensation factor is invoked to perform scattering subtraction calculations on the total transmittance spectrum band by band. The calculation process can be expressed as follows:

[0059] in, For effective absorption spectrum; For the total transmittance spectrum; This is the scattering compensation factor. In this step, the original total transmittance spectrum is corrected band by band, the scattering effect is subtracted, and only the absorption characteristics are retained, thus obtaining the effective absorption spectrum that directly corresponds to the sample component content.

[0060] Based on this embodiment, the present invention can separate scattering and absorption effects in complex emulsion systems, improving the accuracy and stability of spectral data. Its effective absorption spectrum avoids baseline drift and peak distortion caused by scattering, enabling subsequent component calculation models based on absorption characteristics to output more accurate results for fat, protein, and lactose content.

[0061] Step S5: Input the effective absorption spectrum into the component calculation model and output the content of each target component of the dairy product to be tested.

[0062] Specifically, the effective absorption spectrum is divided into multiple characteristic intervals according to the wavelength, and the absorption intensity of each characteristic interval is used as the input variable; the regression equation corresponding to the target component is called in the component calculation model, and quantitative calculation is performed on each target component; wherein, each target component is fat, protein and / or lactose; after the quantitative calculation is completed, the content of each target component is output, and the content result and the corresponding effective absorption spectrum are stored together.

[0063] In this embodiment of the invention, after obtaining the effective absorption spectrum after scattering compensation, the spectrum needs to be further used for component calculation to achieve quantitative detection of key target components in dairy products. Since dairy products are a typical multi-component complex system, their main components include fat, protein, and lactose, each of which has characteristic absorption peaks in different spectral bands. By constructing a component calculation model, the effective absorption spectrum can be converted into numerical component content results, thereby achieving the purpose of quality detection.

[0064] The specific operating procedure is as follows: First, the effective absorption spectrum is divided into several characteristic intervals according to wavelength range. The determination of these characteristic intervals is not arbitrary but based on the optical absorption characteristics of each target component in the dairy product. For example, fat exhibits strong CH stretching vibration absorption peaks near 1200 nm and 1720 nm; protein shows absorption characteristics of NH and C=O groups around 1500 nm and 2050 nm; and lactose has OH stretching-related absorption peaks near 1400 nm and 1900 nm. Therefore, the effective absorption spectrum can be segmented according to these known characteristic bands, and the absorption intensity within each characteristic interval will be used as an input variable. The advantage of this approach is that it avoids noise interference from irrelevant bands, making the input data more focused on information related to the target component.

[0065] Next, the regression equation corresponding to the target component is called in the component calculation model. The regression equation is a mathematical relationship established during the modeling phase using a large number of dairy product samples with known component contents. Taking partial least squares regression (PLS) as an example, its basic form can be expressed as:

[0066] Among them, C j Indicates the content of the j-th target component (such as fat, protein, or lactose); A i w represents the absorption intensity in the i-th characteristic band. ji b is the regression coefficient between this component and this band. jThe constant term is the bias; n is the number of characteristic bands. This equation links the spectral signal to the actual component content. To improve accuracy, cross-validation is typically introduced during modeling to ensure that the established regression coefficients apply not only to the training samples but also to unknown test samples.

[0067] During quantitative calculations, the component calculation model calls the regression equations for fat, protein, and lactose separately. Each equation, for a specific component, uses a weighted superposition of its spectral characteristics across different wavelengths to obtain the predicted content of that component. For example, for fat, it may be necessary to focus on the absorption intensities around 1720 nm and 2300 nm; while for lactose, it relies more on the characteristic peaks in the 1400 nm and 1900 nm range. This multi-band weighted calculation significantly improves prediction accuracy and avoids the influence of noise or instrument drift on a single wavelength.

[0068] After completing the quantitative calculation, the output is the content value of each target component. These contents can be expressed in standard forms such as percentage or g / 100mL, depending on the application scenario required for the detection. It is worth mentioning that, to ensure data traceability and reusability, this embodiment also requires storing the content results along with the corresponding effective absorption spectra. This is significant because, if subsequent verification of the results for a batch of samples is needed, the effective absorption spectra at that time can be directly retrieved and compared with the calculated results, thereby improving the transparency and reliability of quality management.

[0069] This invention divides the effective absorption spectrum into multiple characteristic intervals and performs regression calculations based on a component calculation model. This not only accurately distinguishes and quantifies key components such as fat, protein, and lactose, but also effectively avoids calculation errors caused by scattering interference, baseline drift, or noise interference. Compared with existing methods that rely on empirical formulas or single-band ratio methods, this method has higher stability and applicability, making it particularly suitable for scenarios involving significant differences in dairy product composition or batch testing.

[0070] In one specific embodiment, three types of dairy product samples were selected as the test objects: whole milk, low-fat milk, and pure milk powder reconstituted solution. To ensure consistency in the testing, all samples were equilibrated at 25°C for 2 hours before testing, and then injected into a constant-temperature colorimetric cell with a 10mm optical path length. A constant-temperature water jacket was installed on the outer wall of the colorimetric cell, and constant-temperature water was circulated inside the jacket with a temperature control accuracy of ±0.2°C to avoid scattering fluctuations caused by changes in sample temperature.

[0071] The light source employs a multi-band LED array, covering a wavelength range of 400nm to 2200nm. Ten characteristic bands are selected, corresponding to 450nm, 620nm, 760nm, 980nm, 1200nm, 1450nm, 1720nm, 1940nm, 2100nm, and 2300nm, respectively. Each band of LEDs is driven at a 1kHz pulse frequency and is lit sequentially within one sampling period to obtain an incident light sequence covering the entire wavelength range.

[0072] During the acquisition phase, the sample channel and reference channel operate simultaneously. Taking whole milk sample as an example, the transmitted light intensity detected by the sample channel at 1720 nm is 0.243, while the intensity of the reference channel at the same wavelength is 0.315. Through ratio calculation and normalization, the intermediate spectral value for this wavelength is obtained as 0.772. After further dark current subtraction and baseline smoothing, the corrected spectral value for this wavelength is 0.765. The above processing is repeated for all wavelengths to finally obtain the complete corrected spectral curve.

[0073] After the calibrated spectrum is introduced into the integrating sphere, the inner wall of the integrating sphere is coated with PTFE with a reflectivity of 97%. The inlet diameter is set to 20 mm, and the sphere diameter is 200 mm, ensuring that the ratio of the inlet diameter to the sphere diameter does not exceed 1 / 10. After multiple diffuse reflections inside the integrating sphere, the incident light forms a uniform light field distribution. The total transmission spectrum is obtained by integrating the luminous flux. For example, in the 1450 nm band, the total transmission spectral intensity is 0.621 for whole milk, 0.732 for low-fat milk, and 0.689 for reconstituted milk powder.

[0074] To eliminate the influence of scattering, data from the annular multi-angle light-collecting windows on the outer wall of the colorimetric cell were further introduced. In this experiment, the windows were set at five angles: 30°, 60°, 90°, 120°, and 150°. Taking the scattering intensity of whole milk at a 90° angle as an example, the measured value was 0.158, which was normalized to 0.162. All angle data, along with the corresponding bands of the total transmittance spectrum, were input into the finite-angle sampling Mie scattering inversion. The calculated equivalent particle size distribution at 1720 nm was found to have a peak value of 3.2 μm and an effective scattering coefficient μs of 1.47 cm⁻¹. -1 A compensation matrix was constructed based on these parameters, and the effective absorption spectrum was obtained after subtracting the scattering contribution. In the 1720 nm band, the effective absorption spectrum value of whole milk was corrected to 0.812.

[0075] The effective absorption spectrum is input into the component calculation model, band intervals are divided, and regression calculations are performed. The regression equation called by the model was trained during the modeling phase using 50 known component samples. Taking whole milk as an example, the output fat content is 3.7%, protein content is 3.2%, and lactose content is 4.8%. Compared with the measured results of standard methods (Soxhlet extraction and Kjeldahl nitrogen determination) (fat 3.6%, protein 3.1%, lactose 4.9%), the deviations are all controlled within ±0.2%. For low-fat milk and reconstituted milk powder, the output fat content is 1.1% and 0.5%, protein content is 3.0% and 3.3%, and lactose content is 4.7% and 5.0%, respectively, showing good consistency with the control experimental values.

[0076] Figure 2 This is a system structure diagram of a dairy product quality testing system based on spectral analysis provided in one embodiment of the present invention. Figure 2 As shown, this invention provides a dairy product quality testing system based on spectral analysis. The system includes: a first acquisition unit for introducing the dairy product sample to be tested into a constant-temperature colorimetric cell, emitting incident light using a modulated light source, and simultaneously acquiring original spectral signals in the sample channel and reference channel; a correction unit for generating a correction spectrum based on the original spectral signals, and inputting the correction spectrum into an integrating sphere to collect omnidirectional transmitted light to obtain a total transmission spectrum; a second acquisition unit for acquiring scattering distribution data at different angles based on a ring-shaped multi-angle detector array deployed on the outer wall of the constant-temperature colorimetric cell; a compensation unit for constructing a scattering compensation factor based on the scattering distribution data and the total transmission spectrum, and applying the scattering compensation factor to the total transmission spectrum to obtain an effective absorption spectrum; and an output unit for inputting the effective absorption spectrum into a component calculation model to output the content of each target component in the dairy product to be tested.

[0077] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0078] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details described above. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention. It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe the various possible combinations.

[0079] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the embodiments of the present invention, they should also be regarded as the content disclosed by the embodiments of the present invention.

Claims

1. A method for quality detection of dairy products based on spectral analysis, characterized in that, The method includes: The dairy product sample to be tested is introduced into a constant temperature colorimetric cell, and incident light is emitted using a modulated light source. At the same time, the original spectral signals are collected in the sample channel and the reference channel. A corrected spectrum is generated based on the original spectral signal, and the corrected spectrum is input into an integrating sphere to collect omnidirectional transmitted light to obtain the total transmission spectrum. Data on scattering distribution at different angles is obtained by deploying a ring-shaped multi-angle detector array on the outer wall of the constant-temperature colorimetric cell. A scattering compensation factor is constructed based on the scattering distribution data and the total transmission spectrum, and the scattering compensation factor is applied to the total transmission spectrum to obtain an effective absorption spectrum. The effective absorption spectrum is input into the component calculation model, and the content of each target component in the dairy product to be tested is output.

2. The method according to claim 1, characterized in that, The modulated light source is a multi-band LED array, with each band emitting incident light according to a preset pulse frequency; Emitting incident light using a modulated light source includes: In each sampling period, the light sources of each band in the multi-band LED array are lit sequentially to obtain incident light covering a preset wavelength range. During the lighting process, the emission timing of each band of light source is pulse-modulated so that the incident light exhibits modulation characteristics corresponding to the preset pulse frequency in the time domain. When a sampling cycle is completed, the output is an incident light sequence that covers a preset wavelength range and has pulse modulation characteristics.

3. The method according to claim 2, characterized in that, The sample channel is located on the light-emitting side of the constant temperature colorimetric cell and is used to collect the spectral signal of the dairy product sample after transmission under the action of incident light. The reference channel is configured as an optical path parallel to the constant-temperature colorimetric cell, used to acquire the spectral signal of the sample that has not passed through the dairy product, as a reference for generating the calibration spectrum.

4. The method according to claim 3, characterized in that, Simultaneously, raw spectral signals are acquired in both the sample and reference channels, including: During the process of incident light sequence irradiating the colorimetric cell, the spectral signal after passing through the dairy product sample is detected in the sample channel, and the original spectrum of the sample channel is generated; During the process of incident light sequence irradiating the reference path, the spectral signal of the sample that does not pass through the dairy product sample is detected in the reference channel, and the original spectrum of the reference channel is generated. The original spectra of the sample channel and the original spectra of the reference channel are stored separately and used as the original spectral signals.

5. The method according to claim 4, characterized in that, Generating a corrected spectrum based on the original spectral signal includes: Intensity normalization is performed on the raw spectral signal of the reference channel to obtain the emission reference of the light source in the current sampling period; The ratio of the original spectral signal of the sample channel to the emission reference is calculated band by band to obtain the intermediate spectrum after the influence of light source intensity drift has been eliminated. Dark current subtraction and baseline smoothing are performed on the intermediate spectrum to output the corrected spectrum.

6. The method according to claim 1, characterized in that, The corrected spectrum is input into an integrating sphere to collect omnidirectional transmitted light, yielding the total transmission spectrum, including: The corrected spectrum is introduced into the inlet of the integrating sphere through the outlet of the colorimetric cell, and the inlet diameter of the integrating sphere and the reflectivity of the inner wall are limited to meet a preset ratio to ensure that incident light from different angles is collected. After multiple diffuse reflections occur on the inner surface of the integrating sphere, the transmitted light from each angle is combined into a uniform light field distribution by utilizing the optical path homogenization effect inside the sphere. By performing luminous flux integration on a uniform light field distribution, the total transmission spectrum is obtained.

7. The method according to claim 1, characterized in that, Based on acquiring scattering distribution data at different angles by deploying a ring-shaped multi-angle detector array on the outer wall of the isothermal colorimetric cell, including: Multiple light-receiving windows are set at preset angle intervals on the outer wall of the constant temperature colorimetric cell so that the scattered light passing through the dairy product sample can be emitted at different angles. The scattering intensity values ​​at each light-collecting window are sequentially acquired at corresponding angles, and the scattering intensity values ​​are arranged in the acquisition order to form an angular intensity sequence; The angular intensity sequence is normalized to eliminate the influence of path length differences at different angles, and scattering distribution data is output.

8. The method according to claim 1, characterized in that, A scattering compensation factor is constructed based on the scattering distribution data and the total transmission spectrum, and the scattering compensation factor is applied to the total transmission spectrum to obtain an effective absorption spectrum, including: The scattering distribution data and the total transmission spectrum are input into the Mie scattering inversion operation with finite angle sampling according to the band correspondence, and the equivalent particle size distribution parameters and effective scattering coefficients under each band are calculated. A compensation matrix is ​​generated based on the equivalent particle size distribution parameters and the effective scattering coefficient, and the compensation matrix is ​​stored as a scattering compensation factor. The scattering compensation factor is invoked to perform scattering subtraction operation on the total transmission spectrum band by band, and the effective absorption spectrum is output.

9. The method according to claim 1, characterized in that, The effective absorption spectrum is input into the component calculation model, which outputs the content of each target component in the dairy product under test, including: The effective absorption spectrum is divided into multiple characteristic intervals according to the waveband, and the absorption intensity of each characteristic interval is used as the input variable; The component calculation model calls the regression equation corresponding to the target component, and performs quantitative calculations on each target component; among which... The target components are fat, protein, and / or lactose; After completing the quantitative calculation, the content of each target component is output, and the content results are stored together with the corresponding effective absorption spectrum.

10. A dairy product quality detection system based on spectral analysis, characterized in that, The system includes: The first acquisition unit is used to introduce the dairy product sample to be tested into the constant temperature colorimetric cell, emit incident light using a modulated light source, and simultaneously acquire the original spectral signal in the sample channel and the reference channel. A correction unit is used to generate a correction spectrum based on the original spectral signal, and input the correction spectrum into an integrating sphere to collect omnidirectional transmitted light to obtain the total transmission spectrum. The second acquisition unit is used to acquire scattering distribution data at different angles based on a ring-shaped multi-angle detector array deployed on the outer wall of the constant temperature colorimetric cell. A compensation unit is used to construct a scattering compensation factor based on the scattering distribution data and the total transmission spectrum, and to apply the scattering compensation factor to the total transmission spectrum to obtain an effective absorption spectrum. The output unit is used to input the effective absorption spectrum into the component calculation model and output the content of each target component of the dairy product to be tested.

Citation Information

Patent Citations

  • Milk product quality analysis method and device

    CN117074328A

  • Crop information acquisition and three-dimensional image presentation method, device and system

    CN117635839A

  • Agricultural product quality detection method and system

    CN119804377A

  • Construction method and device of turbidity test system based on photoelectric detector

    CN120385654A

  • Zymophyte detection method and system for yoghourt production process

    CN120706999A

Cited By

  • Signal processing method of multi-parameter water quality analyzer and related device

    CN121453698A