A Smart Egg Quality Detection Method and System Based on Spectral Data

By applying a multi-frequency composite modulation excitation optical signal and combining frequency demodulation and dynamic optical path correction technology, the problem of optical path length fluctuation caused by changes in egg posture was solved, realizing online non-destructive intelligent detection of egg quality and improving detection accuracy and production line adaptability.

CN123111978APending Publication Date: 2026-11-17SHANXI AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611622384.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing spectral detection methods suffer from fluctuations in optical path length due to changes in egg posture during egg quality testing, affecting detection accuracy and production line adaptability.

Method used

A multi-frequency composite modulation excitation optical signal is applied, the spectral response signal is collected and the motion state parameters are acquired simultaneously, and the corrected spectral data is generated through frequency demodulation and dynamic optical path correction. Multi-scale spectral features are extracted and nonlinear enhancement transformation is performed, and the data is input into the quality assessment model to determine the comprehensive quality level.

Benefits of technology

It enables online, non-destructive, intelligent detection of egg quality, improving detection accuracy and production line adaptability, and ensuring the consistency of spectral data and the accuracy of feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123111978A_ABST
    Figure CN123111978A_ABST
Patent Text Reader

Abstract

This application provides an intelligent egg quality detection method and system based on spectral data, belonging to the field of intelligent detection technology. The method involves applying a multi-frequency composite modulation excitation light signal to the egg to be tested, acquiring the spectral response signal of the egg under the multi-frequency composite modulation excitation light signal, and obtaining the motion state parameters of the egg. The spectral response signal is then frequency-demodulated, and path length correction is performed based on the demodulation result to generate first corrected spectral data. The dynamic optical path change is predicted based on the motion state parameters, and the first corrected spectral data is corrected using the dynamic optical path change to generate second corrected spectral data. Multi-scale spectral features are extracted from the second corrected spectral data to generate a quality characterization feature vector. This feature vector is then input into a quality assessment model to determine the comprehensive quality grade of the egg. This application enables online non-destructive intelligent detection of egg quality, improving detection accuracy and production line adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent detection technology, and more specifically, to an intelligent detection method and system for egg quality based on spectral data. Background Technology

[0002] Spectroscopic detection technology, due to its rapid and non-destructive characteristics, has been widely used in the field of poultry egg quality testing. Currently, visible and near-infrared transmission spectroscopy combined with chemometric methods can achieve online detection and grading of egg freshness. The conveyor line is typically equipped with photoelectric sensors to trigger spectral acquisition; eggs continuously pass through the detection station via the conveyor, and spectral data is collected and analyzed during the movement.

[0003] Existing spectral detection methods typically use the acquired spectral signals directly for modeling and analysis. However, the real-time changes in the posture of eggs during high-speed transport cause instantaneous fluctuations in the effective optical path length between the light source and the detector. This results in motion interference components unrelated to the egg's internal quality being mixed into the acquired spectral signal, affecting the accuracy of the detection model in extracting quality information and limiting online detection precision and production line adaptability. Therefore, how to achieve online non-destructive intelligent detection of egg quality and improve detection precision and production line adaptability is a challenge facing the industry. Summary of the Invention

[0004] This application provides a method and system for intelligent detection of egg quality based on spectral data, which can realize online non-destructive intelligent detection of egg quality, improve detection accuracy and production line adaptability.

[0005] In a first aspect, this application provides an intelligent detection method for egg quality based on spectral data, the intelligent detection method comprising the following steps:

[0006] A multi-frequency composite modulation excitation light signal is applied to the egg to be tested, and the spectral response signal of the egg to be tested under the multi-frequency composite modulation excitation light signal is collected. At the same time, the motion state parameters of the egg to be tested during the transportation process are acquired.

[0007] The spectral response signal is frequency demodulated, and the path length of the spectral response signal is corrected according to the demodulation result to generate first corrected spectral data. The dynamic optical path change is predicted according to the motion state parameters, and the first corrected spectral data is corrected using the dynamic optical path change to generate second corrected spectral data.

[0008] Extract multi-scale spectral features from the second corrected spectral data, perform nonlinear enhancement transformation on the multi-scale spectral features, and generate a quality characterization feature vector;

[0009] The feature vector is input into a preset quality assessment model to determine the overall quality grade of the egg to be tested.

[0010] In this embodiment, the multi-frequency composite modulation excitation optical signal is a composite modulation signal composed of multiple superimposed sine waves of different frequencies.

[0011] In this embodiment, the motion state parameters include the real-time spatial position parameters, instantaneous velocity parameters, and attitude angle parameters of the egg under test during the transportation process; the attitude angle parameters include the angle between the major axis of the egg under test and the horizontal plane.

[0012] In this embodiment, frequency demodulation is performed on the spectral response signal, and path length correction is performed on the spectral response signal based on the demodulation result to generate first corrected spectral data. Specifically, this includes:

[0013] Separate the fundamental frequency component and at least one harmonic component from the spectral response signal, and determine the phase delay between the fundamental frequency component and the harmonic component;

[0014] The equivalent optical path length of the egg under test is determined based on the phase delay, and the ratio of the standard optical path length to the equivalent optical path length is used as the optical thickness correction factor.

[0015] The path length of the spectral response signal is corrected according to the optical thickness correction factor to generate the first corrected spectral data.

[0016] In this embodiment, when there are multiple harmonic components, the optimal harmonic component is selected from the multiple harmonic components according to the ratio of the signal strength to the noise level of each harmonic component, and the equivalent optical path length is determined by the phase delay between the fundamental frequency component and the optimal harmonic component.

[0017] In this embodiment, the step of predicting the dynamic optical path change based on the motion state parameters, correcting the first corrected spectral data using the dynamic optical path change, and generating the second corrected spectral data specifically includes:

[0018] Based on the motion state parameters, the dynamic optical path change caused by the change in posture of the egg under test during transportation is determined;

[0019] Obtain the optical absorption coefficient of the egg to be tested, and determine the optical path correction factor corresponding to the dynamic optical path change based on the dynamic optical path change and the optical absorption coefficient.

[0020] The first corrected spectral data is corrected according to the optical path correction factor to generate the second corrected spectral data.

[0021] In this embodiment, determining the dynamic optical path change of the egg under test caused by posture changes during transport, based on the motion state parameters, specifically includes:

[0022] Based on the attitude angle parameters in the motion state parameters, the dynamic optical path change is determined through a pre-established mapping relationship of attitude angle optical path change.

[0023] The mapping relationship was obtained through Monte Carlo simulation and is used to characterize the trend of equivalent optical path variation of a large number of scattered photons under statistical average at different attitude angles.

[0024] In this embodiment, the preset method of the quality assessment model specifically includes:

[0025] Acquire training samples, and use elastic network regression to select features from the training samples to determine the combination of feature wavelengths related to egg quality;

[0026] The first latent variable related to freshness and the second latent variable related to the degree of protein hydrolysis were extracted from the combination of characteristic wavelengths by partial least squares regression.

[0027] The first latent variable and the second latent variable are input into a pre-trained classifier, which outputs the overall quality grade of the egg to be tested.

[0028] In this embodiment, the overall quality level label of the training samples is obtained by joint calibration through Hough unit value determination and internal anomaly detection.

[0029] Secondly, this application provides an intelligent egg quality detection system based on spectral data, used to execute an intelligent egg quality detection method based on spectral data, the intelligent detection system comprising:

[0030] The data acquisition module is used to apply a multi-frequency composite modulation excitation light signal to the egg under test, acquire the spectral response signal of the egg under test under the multi-frequency composite modulation excitation light signal, and simultaneously acquire the motion state parameters of the egg under test during the transportation process.

[0031] The data correction module is used to perform frequency demodulation on the spectral response signal, perform path length correction on the spectral response signal according to the demodulation result, generate first corrected spectral data, predict the dynamic optical path change according to the motion state parameters, correct the first corrected spectral data using the dynamic optical path change, and generate second corrected spectral data.

[0032] The feature extraction module is used to extract multi-scale spectral features from the second corrected spectral data, perform nonlinear enhancement transformation on the multi-scale spectral features, and generate a quality characterization feature vector.

[0033] The quality assessment module is used to input the feature vector into a preset quality assessment model to determine the overall quality grade of the egg to be tested.

[0034] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects:

[0035] A multi-frequency composite modulation excitation light signal is applied to the egg under test, and the spectral response signal of the egg under test under the multi-frequency composite modulation excitation light signal is acquired. Simultaneously, the motion state parameters of the egg under test during transport are acquired. The spectral response signal is frequency demodulated, and the path length is corrected based on the demodulation result to generate first corrected spectral data. The dynamic optical path change is predicted based on the motion state parameters, and the first corrected spectral data is corrected using the dynamic optical path change to generate second corrected spectral data. Multi-scale spectral features are extracted from the second corrected spectral data, and nonlinear enhancement transformation is performed on the multi-scale spectral features to generate a quality characterization feature vector. The feature vector is input into a preset quality assessment model to determine the overall quality level of the egg under test.

[0036] Therefore, this application firstly applies a multi-frequency composite modulation excitation light signal to the egg under test and simultaneously collects the transmission spectral response signal and motion state parameters, providing a data foundation for subsequent frequency demodulation and dynamic compensation. Secondly, by extracting the phase delay through frequency demodulation and correcting the path length, the spectral data of all eggs are aligned under the same effective optical path reference, eliminating individual differences and motion interference unrelated to egg quality, improving the consistency of the spectral data on which subsequent feature extraction is based, and providing a data foundation for quality assessment. Then, by extracting multi-scale spectral features, the effective features are made more discriminative after transformation, enhancing the feature's ability to represent quality changes and providing input features for the subsequent quality assessment model. Finally, the quality assessment model automatically outputs a comprehensive quality level, realizing the mapping from spectral features to quality level, improving the detection accuracy of egg quality and the adaptability to the production line.

[0037] In summary, the technical solution adopted in this application can realize online non-destructive intelligent detection of egg quality, improving detection accuracy and production line adaptability. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this embodiment of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1This is an exemplary flowchart of an intelligent egg quality detection method based on spectral data provided in this application;

[0040] Figure 2 This is a schematic diagram of the device structure of the intelligent egg quality detection system based on spectral data provided in this application;

[0041] Figure 3 This is a module structure diagram of the intelligent egg quality detection system based on spectral data provided in this application. Detailed Implementation

[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0043] This application provides an intelligent egg quality detection method and system based on spectral data. The core of the method involves applying a multi-frequency composite modulation excitation light signal to the egg to be tested, acquiring the spectral response signal of the egg under the multi-frequency composite modulation excitation light signal, and simultaneously acquiring the motion state parameters of the egg during transport. The spectral response signal is frequency demodulated, and path length correction is performed based on the demodulation result to generate first corrected spectral data. The dynamic optical path change is predicted based on the motion state parameters, and the first corrected spectral data is corrected using the dynamic optical path change to generate second corrected spectral data. Multi-scale spectral features are extracted from the second corrected spectral data, and nonlinear enhancement transformation is performed on the multi-scale spectral features to generate a quality characterization feature vector. The feature vector is input into a preset quality assessment model to determine the overall quality grade of the egg to be tested.

[0044] Example 1: To better understand the above technical solution, the following will provide a detailed description of the technical solution in conjunction with the accompanying drawings and specific implementation methods. (Refer to...) Figure 1 As shown in the figure, this is an exemplary flowchart of an intelligent egg quality detection method based on spectral data according to this embodiment of the present application. The intelligent detection method includes the following steps:

[0045] In step S1, a multi-frequency composite modulation excitation light signal is applied to the egg to be tested, the spectral response signal of the egg to be tested under the multi-frequency composite modulation excitation light signal is collected, and the motion state parameters of the egg to be tested during the transportation process are acquired simultaneously.

[0046] In practical implementation, a multi-frequency composite modulation excitation light signal is applied to the egg under test. The spectral response signal of the egg under test under the multi-frequency composite modulation excitation light signal is collected, and the motion state parameters of the egg under test during the conveying process are acquired simultaneously. That is, the egg under test is placed in a single row on the concave rollers of the conveying device and continuously driven by the chain. The conveying speed is set according to the production line requirements. The long axis of the egg on the concave rollers is kept basically parallel to the conveying direction, and the egg undergoes certain posture changes with the rollers during the conveying process. Angle sensors and speed sensors are installed at the candling station of the conveyor line. When the egg enters the candling station, the speed sensor detects the running speed of the conveyor chain in real time and outputs instantaneous speed parameters. The angle sensor detects the angle between the long axis of the egg and the horizontal plane and the real-time spatial position coordinates of the egg on the rollers. At the candling station of the conveyor line, a multi-frequency composite modulation light source is installed in the gap of the concave rollers below the conveyor chain. The multi-frequency composite modulation light source includes at least two laser diodes with different center wavelengths. Its driving current is controlled by a direct digital frequency synthesizer, which can output a composite modulation signal composed of multiple superimposed sine waves of different frequencies. When the egg to be tested is transported to the candling station by the conveyor device, a multi-frequency composite modulation light source applies a multi-frequency composite modulation excitation light signal to the egg. This light signal is composed of multiple laser components of different wavelengths, each modulated by a sine wave of different frequencies and then superimposed. The modulation frequencies are used to encode the different wavelength components, making each wavelength component distinguishable in the frequency domain. Different wavelength components have different penetration depths; longer wavelength components penetrate deeper and are used to obtain information about the deeper layers of the egg white, while shorter wavelength components penetrate shallower and are used to obtain information about the surface layer of the eggshell. The combination of modulation frequencies is independent of the eggshell thickness; the actual penetration depth is determined by the selected wavelength.

[0047] In addition, in practical implementation, a photoelectric sensor is installed at the entrance of the egg candling station. When an egg reaches the candling position, the photoelectric sensor detects the arrival signal and sends it to the control unit, triggering spectral acquisition. The spectral acquisition device collects the diffuse transmission spectrum signal after the egg has passed through it using a collimating lens and optical fiber located at the top of the candling box. The acquisition wavelength range covers the visible to near-infrared band, and the integration time is dynamically adjusted according to the conveyor speed. The acquired spectral response signal is converted from analog to digital and transmitted to the control unit in digital signal form. It is then time-matched with the synchronously acquired motion state parameters and stored.

[0048] In step S2, the spectral response signal is frequency demodulated, and the path length of the spectral response signal is corrected according to the demodulation result to generate first corrected spectral data. The dynamic optical path change is predicted according to the motion state parameters, and the first corrected spectral data is corrected using the dynamic optical path change to generate second corrected spectral data.

[0049] In this embodiment, the spectral response signal is frequency demodulated, and the path length of the spectral response signal is corrected based on the demodulation result to generate first corrected spectral data. This can be achieved through the following steps:

[0050] Separate the fundamental frequency component and at least one harmonic component from the spectral response signal, and determine the phase delay between the fundamental frequency component and the harmonic component;

[0051] The equivalent optical path length of the egg under test is determined based on the phase delay, and the ratio of the standard optical path length to the equivalent optical path length is used as the optical thickness correction factor.

[0052] The path length of the spectral response signal is corrected according to the optical thickness correction factor to generate the first corrected spectral data.

[0053] In practice, firstly, the fundamental frequency component and at least one harmonic component can be separated from the spectral response signal. The phase delay between the fundamental and harmonic components is then determined. Specifically, a fast Fourier transform is performed on the acquired time-domain spectral response signal to convert it to the frequency domain. In the frequency domain, the first phase angle corresponding to the fundamental frequency component and the second phase angle corresponding to the harmonic component are extracted, and the difference between the first and second phase angles is used as the phase delay. The harmonic component is preferably a second or third harmonic component, whose signal strength is sufficient to ensure the accuracy of phase extraction. Then, the equivalent optical path length of the egg under test is determined based on the phase delay. The ratio of the standard optical path length to the equivalent optical path length is used as the optical thickness correction factor. This is because, when the multi-frequency composite modulated excitation light signal penetrates the egg, the propagation speeds of different wavelengths of light components in the eggshell and egg liquid medium differ—different wavelengths correspond to different refractive indices and group velocities—leading to a phase delay between the fundamental and harmonic components. The phase delay is directly related to the actual propagation path length of the light inside the egg. Those skilled in the art should understand that the phase delay in the above calculation is the principal phase difference. In practical applications, phase unwinding processing is required based on the modulation frequency to eliminate ambiguity caused by phase periodicity. The standard optical path length is obtained through pre-calibration measurement using standard thickness calibration samples. That is, a set of standard eggs with different known shell thicknesses are used to prepare calibration samples, and their corresponding equivalent optical path lengths are measured under standard orientations to establish a standard optical path length database. In subsequent testing, the corresponding standard value is called based on the estimated shell thickness level of the egg to be tested. The optical thickness correction factor is the standard optical path length divided by the equivalent optical path length. The optical thickness correction factor is used to normalize and correct the static optical thickness differences between different individual eggs. Finally, the spectral response signal is path length corrected according to the optical thickness correction factor to generate the first corrected spectral data. That is, the light intensity value of the spectral response signal at each wavelength point is multiplied by the optical thickness correction factor, and the result is used as the first corrected spectral data.

[0054] It should be noted that in this embodiment, the spectral response signal is represented in the form of transmitted light intensity, and the path length correction operation described above is performed directly in the transmitted light intensity domain. Those skilled in the art should understand that transmitted light intensity and absorbance are mutually convertible through the Beer-Lambert law, and the two are equivalent expressions; when expressed in absorbance, the correction method is correspondingly adjusted to a division operation.

[0055] It should be noted that in actual detection, the multi-frequency composite modulation excitation light signal contains multiple frequency components. The spectral response signal generated after penetrating the egg often contains more than one harmonic component, such as second, third, and fourth harmonics. When there are multiple harmonic components, this embodiment preferably adopts a signal-to-noise ratio (SNR)-based optimal selection strategy. The optimal harmonic component is selected from the multiple harmonic components for subsequent calculations of phase delay and equivalent optical path length. That is, the fundamental frequency component and multiple harmonic components are separated from the spectral response signal. The fundamental frequency component corresponds to the lowest modulation frequency among all wavelength components, and its signal strength is usually the largest. The harmonic components correspond to integer multiples of the modulation frequency. Each frequency component can be extracted one by one in the frequency domain using a fast Fourier transform. Then, the ratio of the signal strength to the noise level corresponding to each harmonic component is calculated. For each harmonic component, its amplitude at the corresponding frequency point in the frequency domain is taken as the signal strength, and the average amplitude of the signal-free region near that frequency point is taken as the noise level. The ratio of the two is the SNR of that harmonic component. Next, the signal-to-noise ratios (SNRs) of all harmonic components are compared, and the component with the highest SNR is selected as the optimal harmonic component. The equivalent optical path length is determined by the phase delay between the fundamental frequency component and the optimal harmonic component. Specifically, the first phase angle corresponding to the fundamental frequency component and the second phase angle corresponding to the optimal harmonic component are extracted in the frequency domain, and the difference between the two is taken as the phase delay. The equivalent optical path length is then calculated based on this phase delay using the aforementioned method.

[0056] It should be noted that the above signal-to-noise ratio (SNR) optimization screening method does not require pre-specifying which harmonic component to use. It can adaptively select the optimal one based on the actual signal quality, and has good adaptability to different types of eggs and different testing environments. At the same time, the SNR is a direct measure of signal quality, and using it as a screening criterion has clear physical meaning, is simple and efficient to calculate, and meets the real-time requirements of online detection on the production line. In addition, when the signal of a certain harmonic component is severely attenuated due to individual differences in egg products or external interference, it can automatically switch to other harmonic components with higher SNR to ensure the robustness and stability of the detection.

[0057] In this embodiment, the step of predicting the dynamic optical path change based on the motion state parameters, correcting the first corrected spectral data using the dynamic optical path change, and generating the second corrected spectral data specifically includes:

[0058] Based on the motion state parameters, the dynamic optical path change caused by the change in posture of the egg under test during transportation is determined;

[0059] Obtain the optical absorption coefficient of the egg to be tested, and determine the optical path correction factor corresponding to the dynamic optical path change based on the dynamic optical path change and the optical absorption coefficient.

[0060] The first corrected spectral data is corrected according to the optical path correction factor to generate the second corrected spectral data.

[0061] In practical implementation, firstly, based on the attitude angle parameter in the motion state parameters, the dynamic optical path change caused by the attitude change of the egg under test during transportation is determined. This process will be explained in detail in the following steps. Then, the optical absorption coefficient of the egg under test is obtained. Based on the dynamic optical path change and the optical absorption coefficient, the optical path correction factor corresponding to the dynamic optical path change is determined. That is, according to Beer-Lambert's law, the transmitted light intensity and optical path are exponentially related, and the optical path correction factor is the negative optical absorption coefficient multiplied by the dynamic optical path change raised to the power of the natural constant. When the dynamic optical path change is small, the optical path correction factor can be approximated as one minus the optical absorption coefficient multiplied by the dynamic optical path change. Finally, the first corrected spectral data is corrected based on the optical path correction factor to generate the second corrected spectral data. That is, the light intensity value of the first corrected spectral data at each wavelength point is multiplied by the optical path correction factor to obtain the corrected second corrected spectral data.

[0062] It should be noted that the above correction operation uses a multiplicative form in the transmitted light intensity domain. When the spectral data is expressed in absorbance form, there is a linear relationship between absorbance and optical path length. The correction method is adjusted accordingly to absorbance minus the optical absorption coefficient multiplied by the dynamic optical path length change. The two forms are physically equivalent and both are effective corrections for optical path length fluctuations caused by attitude changes.

[0063] In this embodiment, determining the dynamic optical path change of the egg under test due to posture changes during transport, based on the motion state parameters, can be achieved through the following steps:

[0064] Based on the attitude angle parameters in the motion state parameters, the dynamic optical path change is determined through a pre-established mapping relationship of attitude angle optical path change.

[0065] The mapping relationship was obtained through Monte Carlo simulation and is used to characterize the trend of equivalent optical path variation of a large number of scattered photons under statistical average at different attitude angles.

[0066] In practical implementation, the geometric and optical parameters of the egg under test are obtained in a standard posture. The optical parameters include the absorption coefficient, scattering coefficient, and anisotropy factor of the eggshell, egg white, and yolk. These optical parameters can be obtained through an integrating sphere system or by consulting relevant literature. For eggs from the same batch on the production line, sampling can be used to determine their average optical parameters. Then, a multilayer scattering medium model of the egg is established based on these parameters. That is, the egg model is divided into an eggshell layer, an egg white layer, and a yolk layer along the direction of light propagation, and each layer is assigned corresponding optical parameters. After the model is established, the incident light source direction is set to a fixed direction, simulating the process of a large number of photons incident at different posture angles. For each posture angle, the random travel paths of a large number of photons within the multilayer scattering medium model of the egg are tracked, and the average propagation path length of the photons at each posture angle is statistically analyzed. The random travel path of each photon is determined by both the absorption coefficient and the scattering coefficient: in each step, the photon randomly changes its propagation direction according to the scattering coefficient and randomly decides whether to be absorbed according to the absorption coefficient, until the photon escapes from the model surface or is completely absorbed. By tracking a large number of photons, typically no less than 10... 6 A random walk process within a multilayer scattering medium model yields the statistically average propagation path length of photons at a given attitude angle. Using the average propagation path length at the standard attitude (where the egg's long axis is perpendicular to the incident light direction) as a benchmark, the deviation of the average propagation path length at each attitude angle from the standard attitude is calculated. This deviation is the equivalent optical path change for that attitude angle. Different attitude angles and their corresponding equivalent optical path changes are stored in a lookup table or fitting function, thus establishing the attitude angle-optical path change mapping relationship. In actual online detection, an angle sensor continuously monitors the attitude angle parameters of the egg under test. The dynamic optical path change is obtained by querying the mapping relationship based on these attitude angle parameters. Specifically, if the attitude angle parameter perfectly matches the discrete angle value in the mapping relationship, the corresponding optical path change is directly read; otherwise, spline interpolation is used to calculate the dynamic optical path change at the current angle from the optical path changes corresponding to adjacent angle values.

[0067] In step S3, multi-scale spectral features are extracted from the second corrected spectral data, and nonlinear enhancement transformation is performed on the multi-scale spectral features to generate a quality characterization feature vector.

[0068] In practical implementation, multi-scale spectral features are extracted from the second-corrected spectral data. These features are then subjected to a nonlinear enhancement transform to generate a quality characterization feature vector. Specifically, the multi-scale spectral features include: the energy distribution characteristics of the second-corrected spectral data under multiple wavelet bases at different scales, and the zero-crossing offset of the second-order derivative spectrum of the second-corrected spectral data at the characteristic absorption peak. For the wavelet energy distribution features, continuous wavelet transform or discrete wavelet packet decomposition is performed on the second-corrected spectral data. Multiple wavelet basis functions at different scales are selected, such as the Daubechies wavelet family, to decompose the spectral signal into different frequency sub-bands. At each decomposition scale, the energy value of the wavelet coefficients at that scale is calculated, i.e., the sum of the absolute values ​​of the coefficients, forming an energy distribution feature vector that varies with scale. The energy distribution features reflect the energy distribution law of the spectral signal at different frequency scales and can characterize the concentration fluctuation information of the internal components of the egg at different spatial scales. For the zero-crossing offset of the second-order derivative spectrum, the second-order derivative spectrum is first calculated on the second-corrected spectral data, i.e., the second-order differential operation is performed on the spectral intensity at each wavelength point to obtain the curve of the second derivative changing with wavelength. In the second derivative spectrum, the positions corresponding to the absorption peaks in the original spectrum exhibit zero-crossing points, either from positive to negative or from negative to positive. The wavelength positions corresponding to these zero-crossing points are called zero-crossing points. Multiple characteristic absorption peaks, such as the amide I band, amide II band, and lipid characteristic absorption bands, are selected, and their corresponding zero-crossing points are calculated. The offset between their actual positions in the second corrected spectrum and the standard reference positions is used as the zero-crossing point offset features at the characteristic absorption peaks. The standard reference positions are the zero-crossing point positions at the same characteristic absorption peaks in fresh eggs, obtained through pre-measurement of fresh egg samples. The offset reflects information such as changes in the secondary structure of proteins and the degree of lipid oxidation within the egg. Then, a nonlinear enhancement transformation is performed on the multi-scale spectral features to generate quality characterization feature vectors. The nonlinear enhancement transformation uses chaotic mapping to iteratively expand the dimensions of the multi-scale spectral features, and then a sparse autoencoder is used to reduce the dimensions of the expanded features; that is, a Logistic chaotic mapping is selected as the dimension expansion function. The previously extracted multi-scale spectral feature vectors are used as the initial values ​​of the chaotic mapping, and the initial values ​​of the Logistic chaotic mapping are assigned by the fractional part of the optical thickness correction factor. Furthermore, since the number of iterations in the Logistic mapping determines the dimension of the expanded features, preferably, the number of iterations in the Logistic chaotic mapping is dynamically determined based on the instantaneous velocity parameter. The number of iterations is positively correlated with the instantaneous velocity parameter; that is, the higher the transmission speed, the more iterations are needed, and the larger the dimension of the expanded features. Through several iterations, a set of expanded feature vectors traversing each region of the feature space is obtained.The expanded feature vector is then input into a sparse autoencoder for dimensionality reduction. A sparse autoencoder is an unsupervised neural network model that forces the network to learn the essential features of the input data by constraining the average activation value of the hidden layer neurons to be close to zero, i.e., sparsity constraint. After processing by the encoding layer of the sparse autoencoder, the high-dimensional expanded features are compressed into a low-dimensional compact representation, which is the quality representation feature vector.

[0069] It's important to note that the combination of chaotic mapping dimensionality expansion and sparse autoencoder dimensionality reduction described above is not simply a redundant operation of expansion followed by reduction, but rather possesses a clear synergistic logic: chaotic dimensionality expansion utilizes its ergodicity to fully unfold the nonlinear relationships in the original features in a high-dimensional space, allowing the previously mixed information to be separated and explicitly expressed; the sparse autoencoder, on the other hand, automatically learns the optimal feature combination during dimensionality reduction, extracting the most discriminative feature subset from the high-dimensional space. This combination avoids the underfitting that may result from directly performing nonlinear transformations on low-dimensional features, and also avoids the curse of dimensionality and overfitting problems that may occur when performing classification or regression directly in high-dimensional space, thus improving the classification accuracy and generalization ability of the subsequent quality assessment model.

[0070] Furthermore, it should be noted that the number of iterations in the chaotic mapping is dynamically determined based on the instantaneous velocity parameter and is positively correlated with it. The technical basis for this is that within a fixed time window, the higher the conveying speed, the shorter the time required for the egg to pass through the detection station, and the fewer effective scans the spectrometer can collect per unit time, resulting in a decrease in the amount of information contained in the original features extracted from the spectral signal. To compensate for the loss of effective signal features due to the reduced number of sampling points, the dimensionality of the feature space needs to be expanded by increasing the number of iterations in the chaotic mapping. This allows the expanded high-dimensional features to contain richer nonlinear combination information, thus retaining sufficient discriminative features in the subsequent dimensionality reduction process. Therefore, the design of increasing the number of iterations with increasing speed is essentially a signal fidelity strategy for high-speed detection scenarios. In specific implementations, the relationship between the number of iterations and the instantaneous velocity can be determined using a piecewise linear function or a power function. Alternatively, a velocity iteration lookup table can be established in advance through experiments, and the number of iterations can be determined by looking up the table based on the real-time velocity during actual detection. These methods are all conventional implementation techniques that can be directly adopted or easily deduced by those skilled in the art based on actual needs, requiring no creative effort. Furthermore, the initial value of the Logistic chaotic mapping is assigned by the fractional part of the optical thickness correction factor. Its function is that the value of the optical thickness correction factor is usually distributed between 0.5 and 2.0. Taking the fractional part of the factor can ensure that the initial value is always within the effective domain of the Logistic mapping. At the same time, it realizes the direct correlation between the front-end physical correction parameters and the back-end feature enhancement process, so that the evolution trajectory of chaotic dimensional expansion is subject to the personalized constraints of the eggshell thickness difference, thereby enhancing the adaptability of the feature to different individual eggs.

[0071] In step S4, the feature vector is input into a preset quality assessment model to determine the overall quality grade of the egg to be tested.

[0072] In this embodiment, the preset method of the quality assessment model can be implemented by the following steps:

[0073] Acquire training samples, and use elastic network regression to select features from the training samples to determine the combination of feature wavelengths related to egg quality;

[0074] The first latent variable related to freshness and the second latent variable related to the degree of protein hydrolysis were extracted from the combination of characteristic wavelengths by partial least squares regression.

[0075] The first latent variable and the second latent variable are input into a pre-trained classifier, which outputs the overall quality grade of the egg to be tested.

[0076] In practical implementation, firstly, training samples are acquired. Elastic network regression is used to select features from these samples, determining the combination of characteristic wavelengths related to egg quality. That is, the training samples are a set of egg samples with known overall quality grades. These overall quality grades are obtained through a combination of destructive physicochemical testing and calibration. Specifically, for each training sample egg, spectral data is acquired using a spectral acquisition device under identical conditions, followed by destructive testing: the freshness grade is determined by Hough unit measurement, and the presence of internal abnormalities such as blood spots, meat spots, or yolk dispersion is determined by visual inspection and transmittance testing. The combined results of these two tests form the overall quality grade label for the sample. To ensure the representativeness of the training samples and the model's generalization ability, the training samples should cover eggs with different freshness grades, different shell thicknesses, and different internal quality states, with a sample size typically no less than 200 eggs. It should be noted that the Hough unit is an industry-standard quantitative indicator of egg freshness; a higher value indicates a fresher egg. Internal abnormality detection is used to identify the presence of quality defects such as blood spots, meat spots, or yolk dispersion inside the egg. These detection methods are conventional techniques in the field and will not be described in detail in this embodiment. Elastic network regression is a linear regression method that incorporates both L1 and L2 regularization. It performs regression analysis on spectral data across all wavelengths, using the overall quality level of the training samples as the prediction target. Wavelengths with non-zero regression coefficients are selected as characteristic wavelength combinations related to egg quality. The penalty parameters for elastic network regression, namely the L1 and L2 regularization coefficients, are determined through 10-fold cross-validation. This involves randomly dividing the training samples into ten parts, alternating between using nine parts for training the model and one part for validation, and selecting the parameter combination that minimizes the validation error.

[0077] Furthermore, in practical implementation, partial least squares regression is used to extract a first latent variable related to freshness and a second latent variable related to the degree of protein hydrolysis from the combination of feature wavelengths. That is, two prediction models are established using partial least squares regression for the freshness label and the degree of protein hydrolysis label, respectively. For the freshness prediction model, the first latent variable with the strongest correlation to freshness is extracted from the selected combination of feature wavelengths; for the degree of protein hydrolysis prediction model, the second latent variable with the strongest correlation to the degree of protein hydrolysis is extracted from the same combination of feature wavelengths. These two latent variables respectively condense the main information related to freshness and the degree of protein hydrolysis in the original spectrum. Then, the first and second latent variables are input into a pre-trained classifier, which outputs the comprehensive quality grade of the egg to be tested. That is, the classifier is a supervised learning model, including but not limited to any one of support vector machines, random forests, or gradient boosting trees. The training process of the classifier is as follows: the first and second latent variables of the training samples are used as input features, and the comprehensive quality grade label of the training samples is used as the prediction target to train the classifier. By adjusting the classifier's hyperparameters, such as the kernel type and penalty coefficient of the support vector machine, the number of trees and maximum depth of the random forest, and the learning rate and number of iterations of the gradient boosting tree, the classifier can achieve the expected classification accuracy on the training samples. After training, for any egg to be tested, its spectral data is sequentially processed through feature wavelength filtering and latent variable extraction to obtain two latent variables, which are then input into the classifier. The classifier automatically outputs its comprehensive quality level. The comprehensive quality level is preferably divided into multiple levels, such as acceptable and unacceptable.

[0078] In practical implementation, the feature vector is input into a preset quality assessment model to determine the overall quality grade of the egg to be tested. That is, the quality assessment model is preset in the aforementioned manner. In this embodiment, the overall quality grade includes two dimensions: freshness grade and internal anomaly grade. The overall quality grade is the final grade after comprehensively considering both freshness level and internal quality status. Preset quality thresholds include a freshness threshold and an internal quality threshold. When the output of the quality assessment model, i.e., the latent variable score, is simultaneously lower than the freshness threshold and higher than the internal quality threshold, the overall quality grade is determined to be acceptable. Specifically, the first latent variable corresponds to the freshness dimension; a lower score indicates a fresher egg. The second latent variable corresponds to the internal quality dimension, i.e., the degree of protein hydrolysis; a higher score indicates better internal quality. When the first latent variable score is lower than the freshness threshold (i.e., freshness is acceptable) and the second latent variable score is higher than the internal quality threshold (i.e., no internal anomalies), the overall quality grade is determined to be acceptable. Otherwise, it is determined to be unacceptable, and a rejection instruction is triggered. Preferably, when the output of the quality assessment model is higher than the freshness threshold, the freshness of the egg to be tested is determined to be unqualified; when the output of the quality assessment model is lower than the internal quality threshold, the egg to be tested is determined to have an internal abnormality; when either of the above determinations is true, the overall quality grade is determined to be unqualified, and a rejection instruction is triggered. When the overall quality grade is unqualified, the control unit sends a rejection instruction to the grading execution device, and the egg is automatically rejected to the unqualified product collection area when it is transported to the grading exit; when the overall quality grade is acceptable, the egg continues to enter the qualified product collection area or enters the corresponding grading exit according to a more refined grade.

[0079] like Figure 2 As shown in the figure, the intelligent egg quality detection system based on spectral data provided in this solution has the following device structure: the egg to be tested is placed on the concave roller 1 of the conveyor device and continuously passes through the detection station with the conveyor chain; the multi-frequency composite modulation light source 2 is set below the conveyor chain and applies a multi-frequency composite modulation excitation light signal composed of multiple superimposed sine waves of different frequencies to the passing egg; the spectral acquisition device 6 is set above the conveyor chain to collect the diffuse transmission spectral response signal after penetrating the egg; the angle sensor 3 and the speed sensor 4 are installed at the detection station to synchronously acquire the attitude of the egg during the conveying process. The system includes state angle parameters and instantaneous velocity parameters; photoelectric sensor 5 is installed at the entrance of the detection station to detect whether the egg has reached the candling position and trigger spectral acquisition; control and data processing unit 7 is communicatively connected to multi-frequency composite modulation light source 2, spectral acquisition device 6, angle sensor 3, velocity sensor 4, photoelectric sensor 5 and grading execution device 8, respectively, to perform signal demodulation, optical path correction, feature extraction and quality assessment, and send control commands to grading execution device 8 according to the assessment results; grading execution device 8 is set at the end of the conveyor chain and guides the eggs to the corresponding grading exit 9 according to the comprehensive quality level.

[0080] Therefore, this application firstly applies a multi-frequency composite modulation excitation light signal to the egg under test and simultaneously collects the transmission spectral response signal and motion state parameters, providing a data foundation for subsequent frequency demodulation and dynamic compensation. Secondly, by extracting the phase delay through frequency demodulation and correcting the path length, the spectral data of all eggs are aligned under the same effective optical path reference, eliminating individual differences and motion interference unrelated to egg quality, improving the consistency of the spectral data on which subsequent feature extraction is based, and providing a data foundation for quality assessment. Then, by extracting multi-scale spectral features, the effective features are made more discriminative after transformation, enhancing the feature's ability to represent quality changes and providing input features for the subsequent quality assessment model. Finally, the quality assessment model automatically outputs a comprehensive quality level, realizing the mapping from spectral features to quality level, improving the detection accuracy of egg quality and the adaptability to the production line.

[0081] In summary, the technical solution adopted in this application can realize online non-destructive intelligent detection of egg quality, improving detection accuracy and production line adaptability.

[0082] Example 2: This application provides an intelligent egg quality detection system based on spectral data, referring to... Figure 3 As shown in the figure, this is a modular structure diagram of an intelligent egg quality detection system based on spectral data according to this embodiment of the present application. The intelligent detection system includes:

[0083] The data acquisition module 100 is used to apply a multi-frequency composite modulation excitation light signal to the egg under test, acquire the spectral response signal of the egg under test under the multi-frequency composite modulation excitation light signal, and simultaneously acquire the motion state parameters of the egg under test during the transportation process.

[0084] Data correction module 200 is used to perform frequency demodulation on the spectral response signal, perform path length correction on the spectral response signal according to the demodulation result, generate first corrected spectral data, predict dynamic optical path change according to the motion state parameters, correct the first corrected spectral data using the dynamic optical path change, and generate second corrected spectral data.

[0085] The feature extraction module 300 is used to extract multi-scale spectral features from the second corrected spectral data, perform nonlinear enhancement transformation on the multi-scale spectral features, and generate a quality characterization feature vector.

[0086] The quality assessment module 400 is used to input the feature vector into a preset quality assessment model to determine the overall quality grade of the egg to be tested.

[0087] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0088] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0089] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

Claims

1. A smart method for detecting egg quality based on spectral data, characterized in that, The intelligent detection method includes the following steps: A multi-frequency composite modulation excitation light signal is applied to the egg to be tested, and the spectral response signal of the egg to be tested under the multi-frequency composite modulation excitation light signal is collected. At the same time, the motion state parameters of the egg to be tested during the transportation process are acquired. The spectral response signal is frequency demodulated, and the path length of the spectral response signal is corrected according to the demodulation result to generate first corrected spectral data. The dynamic optical path change is predicted according to the motion state parameters, and the first corrected spectral data is corrected using the dynamic optical path change to generate second corrected spectral data. Extract multi-scale spectral features from the second corrected spectral data, perform nonlinear enhancement transformation on the multi-scale spectral features, and generate a quality characterization feature vector; The feature vector is input into a preset quality assessment model to determine the overall quality grade of the egg to be tested.

2. The intelligent egg quality detection method based on spectral data as described in claim 1, characterized in that, The multi-frequency composite modulation excitation optical signal is a composite modulation signal composed of multiple sinusoidal waves of different frequencies superimposed.

3. The intelligent egg quality detection method based on spectral data as described in claim 1, characterized in that, The motion state parameters include the real-time spatial position parameters, instantaneous velocity parameters, and attitude angle parameters of the egg under test during the transportation process; the attitude angle parameters include the angle between the major axis of the egg under test and the horizontal plane.

4. The intelligent egg quality detection method based on spectral data as described in claim 1, characterized in that, The process of frequency demodulating the spectral response signal, and then performing path length correction on the spectral response signal based on the demodulation result to generate first corrected spectral data specifically includes: Separate the fundamental frequency component and at least one harmonic component from the spectral response signal, and determine the phase delay between the fundamental frequency component and the harmonic component; The equivalent optical path length of the egg under test is determined based on the phase delay, and the ratio of the standard optical path length to the equivalent optical path length is used as the optical thickness correction factor. The path length of the spectral response signal is corrected according to the optical thickness correction factor to generate the first corrected spectral data.

5. The intelligent egg quality detection method based on spectral data as described in claim 4, characterized in that, When there are multiple harmonic components, the optimal harmonic component is selected from the multiple harmonic components based on the ratio of the signal strength to the noise level of each harmonic component, and the equivalent optical path length is determined by the phase delay between the fundamental frequency component and the optimal harmonic component.

6. The intelligent egg quality detection method based on spectral data as described in claim 1, characterized in that, The step of predicting the dynamic optical path change based on the motion state parameters, correcting the first corrected spectral data using the dynamic optical path change, and generating the second corrected spectral data specifically includes: Based on the motion state parameters, the dynamic optical path change caused by the change in posture of the egg under test during transportation is determined; Obtain the optical absorption coefficient of the egg to be tested, and determine the optical path correction factor corresponding to the dynamic optical path change based on the dynamic optical path change and the optical absorption coefficient. The first corrected spectral data is corrected according to the optical path correction factor to generate the second corrected spectral data.

7. The intelligent egg quality detection method based on spectral data as described in claim 6, characterized in that, The determination of the dynamic optical path change caused by the change in posture of the egg under test during transportation, based on the motion state parameters, specifically includes: Based on the attitude angle parameters in the motion state parameters, the dynamic optical path change is determined through a pre-established mapping relationship of attitude angle optical path change. The mapping relationship was obtained through Monte Carlo simulation and is used to characterize the trend of equivalent optical path variation of a large number of scattered photons under statistical average at different attitude angles.

8. The intelligent egg quality detection method based on spectral data as described in claim 1, characterized in that, The preset methods of the quality assessment model specifically include: Training samples are obtained, and elastic network regression is used to select features from the training samples to determine the combination of feature wavelengths related to egg quality. The first latent variable related to freshness and the second latent variable related to the degree of protein hydrolysis were extracted from the characteristic wavelength combination by partial least squares regression. The first latent variable and the second latent variable are input into a pre-trained classifier, which outputs the overall quality grade of the egg to be tested.

9. The intelligent egg quality detection method based on spectral data as described in claim 8, characterized in that, The overall quality level label of the training samples was obtained through a combination of Hough unit value determination and internal anomaly detection.

10. An intelligent egg quality detection system based on spectral data, used to execute the intelligent egg quality detection method based on spectral data as described in any one of claims 1 to 9, characterized in that, The intelligent detection system includes: The data acquisition module is used to apply a multi-frequency composite modulation excitation light signal to the egg under test, acquire the spectral response signal of the egg under test under the multi-frequency composite modulation excitation light signal, and simultaneously acquire the motion state parameters of the egg under test during the transportation process. The data correction module is used to perform frequency demodulation on the spectral response signal, perform path length correction on the spectral response signal according to the demodulation result, generate first corrected spectral data, predict the dynamic optical path change according to the motion state parameters, correct the first corrected spectral data using the dynamic optical path change, and generate second corrected spectral data. The feature extraction module is used to extract multi-scale spectral features from the second corrected spectral data, perform nonlinear enhancement transformation on the multi-scale spectral features, and generate a quality characterization feature vector. The quality assessment module is used to input the feature vector into a preset quality assessment model to determine the overall quality grade of the egg to be tested.