A method for monitoring the metabolic state of a dairy cow based on near infrared spectroscopy analysis

CN119438126BActive Publication Date: 2026-08-07HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN UNIV OF SCI & TECH
Filing Date
2024-10-25
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0006]本发明的目的是:针对现有的奶牛代谢状态的监测并不是实时监测的问题,提出一种基于近红外光谱分析的奶牛代谢状态监测方法

Benefits of technology

[0052] This application uses near-infrared spectroscopy to analyze milk samples from milking parlors in dairy farms, measures radiofrequency spectroscopy (RFP), and uses RFP to identify the metabolic state of dairy cows. Therefore, this application does not monitor milk samples in offline mode, but rather in real-time online monitoring. This provides real-time monitoring results of animal health and physiological status during the feeding process in farms, thereby meeting the needs of automated and batch detection in animal husbandry management in the development of precision animal husbandry in the digital information age.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119438126B_ABST
    Figure CN119438126B_ABST
Patent Text Reader

Abstract

The application discloses a kind of dairy cow metabolic state monitoring methods based on near infrared spectroscopy analysis, it is related to dairy cow nutrition metabolic state monitoring field and biological macromolecular component analysis technology, for the monitoring of existing dairy cow metabolic state is not real-time monitoring problem, the application is analyzed by near infrared spectroscopy to dairy cow breeding farm milking hall milk sample, determines RFP, and utilizes RFP to identify the metabolic state of dairy cow, so the application is not in offline mode to the monitoring of milk sample, but online real-time monitoring, thereby giving the real-time monitoring result of the health and physiological state of animal in the process of breeding farm feeding, to further satisfy the detection needs of animal breeding management automation, batch in the development of precise animal husbandry in digital information era.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of monitoring the nutritional and metabolic status of dairy cows and the technology for analyzing biological macromolecular components, specifically a method for monitoring the metabolic status of dairy cows based on near-infrared spectroscopy. Background Technology

[0002] Based on industry development trend analysis, digital technologies in the information age have the potential to gradually transform all industries. Against this backdrop, most domestic and international enterprises face challenges related to technological updates, transformation, or digital upgrades. Precision Livestock Farming (PLF), as an emerging technology, has developed rapidly in recent years, demonstrating a trend of impacting the entire livestock industry and its testing and analysis fields, affecting everything from cattle and pigs to poultry. Dairy farming is one of the sectors most significantly affected. Because precision livestock farming has the potential to generate greater profits and improve animal welfare, its development is still in its early stages.

[0003] In line with the aforementioned development trend, among the many PLF farming technologies, near-infrared spectroscopy (NIR) analysis technology is used for real-time monitoring of milk quality during milking. This can provide dairy farmers with information on the milk characteristics and physiological condition of each cow, which is not only beneficial for analyzing all key control points in dairy cow management, but also can improve animal welfare, production, reproduction and sustainability, as well as farmers' income.

[0004] Near-infrared (NIR) analysis technology studies the physicochemical properties of samples in a non-destructive manner. By integrating fiber optic diffuse reflectance technology and near-infrared spectroscopy, portable NIR spectrometers can be developed for direct use in dairy farm milking parlors, milk collection areas, or dairy product sales locations, enabling simultaneous prediction of multiple parameters of a substance's composition. Compared to other laboratory techniques, this technology offers advantages such as speed, non-destructive nature, portability, and cost-effectiveness. These characteristics have led to the widespread acceptance of near-infrared spectroscopy in recent years, making it one of the most promising methods for analyzing the composition of large molecules, such as those found in dairy products.

[0005] According to standard dairy practices, cows are milked two to three times a day. This means that milk samples from the milking parlor provide real-time information on the current state of the herd and individual cows. Regularly collecting and analyzing the spectral information of these samples allows for real-time understanding of the milk's chemical composition without adversely affecting the animals' daily lives, and also reduces the cost of regular milk analysis. Most recent near-infrared spectroscopy studies have been conducted offline on milk samples, or more precisely, not directly in the milking parlor. Therefore, current technologies for monitoring the metabolic state of dairy cows are not real-time. Summary of the Invention

[0006] The purpose of this invention is to address the problem that existing methods for monitoring the metabolic status of dairy cows are not real-time, and to propose a method for monitoring the metabolic status of dairy cows based on near-infrared spectroscopy analysis.

[0007] The technical solution adopted by the present invention to solve the above-mentioned technical problems is as follows:

[0008] A method for monitoring the metabolic status of dairy cows based on near-infrared spectroscopy includes the following steps:

[0009] The process involves acquiring real-time milk samples from the cows to be monitored, using a trained neural network to obtain the RFP (Real-Time Feedback) of the milk samples, and finally monitoring the metabolic status of the cows based on the RFP.

[0010] A trained neural network is obtained through the following steps:

[0011] Step 1: Obtain milk samples and acquire near-infrared spectral data from the milk samples to obtain spectral data;

[0012] Step 2: Center the spectral data;

[0013] Step 3: Preprocess the standardized spectral data to filter out noise;

[0014] Step 4: Filter the wavelength variables in the preprocessed spectral data;

[0015] Step 5: Extract the fat concentration and protein concentration from the milk sample, and then obtain the ratio of fat concentration to protein concentration, i.e., RFP. Finally, use the screened spectral data as input and RFP as output to train the neural network.

[0016] The specific steps for obtaining the RFP of milk samples produced in real time by the cow under monitoring using a trained neural network are as follows:

[0017] The milk samples produced in real time by the cows to be monitored are processed in steps one through four to obtain the filtered spectral data. The filtered spectral data is then input into the trained neural network to obtain the output RFP.

[0018] Furthermore, the wavelength variable screening is performed using a random frog-jumping method.

[0019] Furthermore, the random frog jumping method is an improved random frog jumping method, in which the initial variable set is obtained through the following steps:

[0020] Obtain the wavelength variable from the spectral data, and calculate the Pearson correlation coefficient ρ(x) between the wavelength variables. i ,xj ), represented as:

[0021]

[0022] Wherein, cov(x) i ,x j ) represents the wavelength variable x i and x j covariance, and For variable x i and x j Standard deviation, E(x) i ) and E(x j ) is the variable x i and x j The expected value of i,j=1,2,…,n, where n is the number of wavelength variables;

[0023] Obtain the information entropy index for each Pearson correlation coefficient, and select the top K0 variables in descending order to form the initial variable set. The information entropy index H(x) of the Pearson correlation coefficient is... j ) is represented as:

[0024]

[0025] Where, r kj r is an intermediate variable kj =|ρ(x) i ,x j )|, K0 is a random number between 1 and n, P(r kj ) is r kj The frequency of.

[0026] Furthermore, the specific preprocessing steps in step three are as follows:

[0027] The spectral data is processed sequentially using a signal sanitization method based on spectral analysis and an orthogonal scattering correction method, specifically as follows:

[0028] Step 1: Perform s repeated measurements on the milk sample, and analyze the spectral data X obtained from each measurement. m×n Principal component analysis was performed to obtain the corresponding score matrix T. m×z and weight matrix P z×n , is represented as:

[0029] X m×n =T m×z P z×n ;

[0030] Step 2: Calculate the arithmetic mean function of the PCi scores of all principal components in the principal component analysis. Sum of standard deviation function and utilize and Obtain the mean square function of the PCi score for each principal component. Represented as:

[0031]

[0032] Where i = 1, 2, ..., z, z is the number of principal components in the principal component analysis, m is the number of samples, and n is the number of wavelength variables;

[0033] Step 3: [Regarding...] Perform a two-dimensional discrete Fourier transform to obtain And based on the frequency increment Δf, the frequency changes from f to f+Δf. Value, finally used Obtain the power spectral density function Represented as:

[0034]

[0035] Where f is the frequency of the spectral data change, and Δf is the frequency increment. It is the mean square value of the frequency range from f to f+Δf, i.e., the second-order raw moment;

[0036] Step 4: Determine the power spectral density function Are all elements in the same value? If the power spectral density function is equal... If all elements in the array are equal and constant, then white noise interference exists, and step 5 is executed; otherwise, step 6 is executed.

[0037] Step 5: Analyze the spectral data X obtained from s repeated measurements. m×n After taking the arithmetic mean, the new spectral test data is used as the new spectral test data. Principal component analysis is then performed on the new spectral test data, and white noise interference is filtered out to obtain the spectral data X'. m×n and the spectral data matrix X' m×n Perform orthogonal scattering correction to complete the preprocessing.

[0038] Spectral data X' m×n Represented as:

[0039] X' m×n =X m×n -T m×1 P 1×n

[0040] Among them, T m×1 The score matrix of principal component PCi, P 1×n The weight matrix of the principal component PCi;

[0041] Step 6: Analyze the spectral data X obtained from s repeated measurements. m×n The arithmetic mean was taken as the new spectral test value X. m×n and the new spectral test data X m×n Perform orthogonal scattering correction to complete the preprocessing.

[0042] Furthermore, the specific steps for monitoring the metabolic status of dairy cows based on RFP are as follows:

[0043] When RFP < 1.0, it is an abnormal result, indicating subclinical acidosis;

[0044] When 1.0≤RFP≤1.5, it is a normal result, indicating a balance of positive energy;

[0045] When 1.5≤RFP≤2.0, it is an abnormal result, indicating a negative energy balance;

[0046] When RFP > 2.0, it is an abnormal result, indicating a subclinical ketosis index in negative energy balance, and there is an increased risk of postpartum disease in animals in early lactation.

[0047] Furthermore, the increased risk of postpartum diseases in animals during early lactation includes retained placenta, left abomasal displacement, endometritis, and clinical endometritis.

[0048] Furthermore, the neural network is a BP neural network.

[0049] Furthermore, the white noise interference is resistive thermal noise interference.

[0050] Furthermore, the fat concentration and protein concentration are determined using chemical analysis methods specified in national standards or using measuring instruments with higher precision.

[0051] The beneficial effects of this invention are:

[0052] This application uses near-infrared spectroscopy to analyze milk samples from milking parlors in dairy farms, measures radiofrequency spectroscopy (RFP), and uses RFP to identify the metabolic state of dairy cows. Therefore, this application does not monitor milk samples in offline mode, but rather in real-time online monitoring. This provides real-time monitoring results of animal health and physiological status during the feeding process in farms, thereby meeting the needs of automated and batch detection in animal husbandry management in the development of precision animal husbandry in the digital information age. Attached Figure Description

[0053] Figure 1 This is a schematic diagram of the method for monitoring the metabolic status of dairy cows in this application;

[0054] Figure 2 This is a schematic diagram of the signal cleanup method based on spectrum analysis in this application;

[0055] Figure 3 This is a schematic diagram illustrating the composition of the principal component score matrix in this application. Detailed Implementation

[0056] It should be noted that, where there is no conflict, the various embodiments disclosed in this application can be combined with each other.

[0057] Specific implementation method one: Refer to Figure 1 This embodiment describes a method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy, comprising the following steps:

[0058] The process involves acquiring real-time milk samples from the cows to be monitored, using a trained neural network to obtain the RFP (Real-Time Feedback) of the milk samples, and finally monitoring the metabolic status of the cows based on the RFP.

[0059] A trained neural network is obtained through the following steps:

[0060] Step 1: Obtain milk samples and acquire near-infrared spectral data from the milk samples to obtain spectral data;

[0061] Step 2: Center the spectral data;

[0062] Step 3: Preprocess the standardized spectral data to filter out noise;

[0063] Step 4: Filter the wavelength variables in the preprocessed spectral data;

[0064] Step 5: Extract the fat and protein concentrations from the milk sample to obtain the ratio of fat to protein concentration, i.e., RFP (ratio off to protein). Finally, use the screened spectral data as input and RFP as output to train the neural network.

[0065] The specific steps for obtaining the RFP of milk samples produced in real time by the cow under monitoring using a trained neural network are as follows:

[0066] The milk samples produced in real time by the cows to be monitored are processed through steps one to four to obtain the spectral data after screening. The screened spectral data is then input into the trained neural network to obtain the output RFP.

[0067] In the method for identifying the metabolic state of dairy cows, milk spectral data acquisition utilizes a near-infrared spectrometer, employing optical fibers to measure the near-infrared spectrum of the sample. Since fats and proteins in milk are biological macromolecules, their molecules can interact with near-infrared light, resulting in near-infrared absorption and scattering. The milk medium exhibits high scattering and high optical density characteristics, and the structural and compositional information of the sample is richly reflected in its diffuse reflectance light. Therefore, diffuse reflectance optical measurement methods can be used to measure the near-infrared spectrum of milk. Furthermore, the use of optical fiber measurement further enhances the simplicity and portability of the test, making real-time and rapid detection of liquid samples and industrial equipment logistics exceptionally convenient.

[0068] Applying near-infrared spectroscopy to precision livestock farming (PLF) systems in dairy farms is not only economically feasible, but also avoids the long wait times of laboratory analysis response by utilizing the portable fiber optic method of near-infrared diffuse reflectance spectroscopy. It allows for timely intervention and prevention, and can be used directly on dairy farms. Through "online" or "real-time" modes, information can be acquired in real time, corrective interventions can be made, and numerous automatic control analyses can be performed.

[0069] In near-infrared spectroscopy analysis, the interaction between the molecules of the analyte and the near-infrared spectral bands primarily stems from combination and overtone absorption, resulting in broad and heavily overlapping absorption bands. Furthermore, the operation of the spectrometer, influenced by factors such as time drift, temperature drift, stray light, and resistive thermal noise from the light source, optical path, power supply, and circuit components, further complicates the near-infrared spectral composition, carrying both noise information and the concentration information of the analyte components. Extracting useful sample information and filtering out noise through spectral analysis is akin to "sifting for gold in sand." Therefore, spectral preprocessing is essential before spectral modeling to filter out noise and extract useful information. Moreover, using full-spectrum wavelength variables in the near-infrared range for modeling leads to an excessive number of uninformative variables, increasing testing time, reducing testing efficiency, and decreasing model prediction accuracy. Additionally, multicollinearity issues exist in wavelength variable modeling during full-spectrum analysis. Therefore, wavelength variable screening is crucial after spectral preprocessing before modeling. Therefore, in the initial stage of spectral preprocessing, this application proposes a signal purification method based on spectrum analysis to remove the influence of white noise, represented by resistive thermal noise, on the spectrum. In the pre-spectral modeling stage, this application uses a random frog-jumping method to screen wavelength variables in spectral data, thereby extracting key feature wavelengths from complex multispectral data to achieve data dimensionality reduction. This method can also select more effective information from the spectrum and improve the signal-to-noise ratio of the modeling data.

[0070] This application utilizes near-infrared spectral data acquisition and analysis of milk samples to determine radioactive precipitate (RFP), thereby identifying the energy balance status of dairy cows during the feeding process and providing monitoring results for subclinical ketosis and subclinical acidosis. This monitoring method is of practical significance for reducing the cost of rapid milk analysis at dairy processing or sales sites and for real-time monitoring of the health and physiological status of farm herds or individual dairy cows.

[0071] The random frog jumping method is an improved random frog jumping method. In the improved random frog jumping method, the initial variable set is obtained through the following steps:

[0072] Obtain the wavelength variable from the spectral data, and calculate the Pearson correlation coefficient ρ(x) between the wavelength variables. i ,x j ), represented as:

[0073]

[0074] Wherein, cov(x) i ,x j ) is the variable x i and x j covariance, and For variable x i and x j Standard deviation, E(x) i ) and E(x j ) is the variable x i and x j The expected value of i,j=1,2,…,n, where n is the number of wavelength variables;

[0075] Obtain the information entropy index for each Pearson correlation coefficient, and select the top K0 variables in descending order to form the initial variable set. The information entropy index H(x) of the Pearson correlation coefficient is... j ) is represented as:

[0076]

[0077] Where, r kj r is an intermediate variable kj =|ρ(x) i ,x j )|, K0 is a random number between 1 and n, P(r kj ) is r kj The frequency of.

[0078] Near-infrared spectroscopy contains a large amount of information irrelevant to the analyte. To effectively extract information about the analyte, near-infrared spectral analysis typically requires preprocessing the original sample spectrum followed by wavelength selection to reduce spectral interference and improve model prediction performance. The improved random frog jumping method described in this application is a minimum redundancy-based improved random frog jumping method. As an emerging subheuristic population intelligent optimization algorithm in evolutionary computation, the random frog jumping (RF) method's greatest advantages are its simple concept, ease of implementation, and strong global search capability. However, for near-infrared spectra of multi-component suspended semi-transparent liquids like milk, simply relying on the original random frog jumping algorithm to randomly generate the initial dataset for wavelength selection suffers from slow convergence and a tendency to get trapped in local optima. Therefore, this application creatively proposes an improved random frog jumping method based on a minimum redundancy generation method for spectral wavelength variables using information entropy. By obtaining the wavelength variable information entropy index, the wavelength variables in the initial random frog jumping dataset are selected, thereby implementing minimum redundancy processing from the initial variable population as the initial seed, thus eliminating multicollinearity among variables.

[0079] The main idea and key technologies for implementing the improved random frog jumping method for spectral wavelength variable selection are as follows:

[0080] (1) The original random frog-jumping algorithm is analyzed. It mainly uses the reversible jumping Markov chain Monte Carlo algorithm to establish a mathematically simple and computationally efficient feature wavelength selection algorithm. A pseudo-MCMC chain is obtained by performing fixed-dimensional and cross-dimensional moving searches in the model space, which is used to calculate the selection probability of each feature variable as the standard for the selection of the feature variable. When using it to extract feature variables, since the initial variable set is randomly drawn from the original dataset, useless or interfering wavelength variables may be introduced, which increases the degree of multicollinearity among variables, thus reducing the predictive ability and convergence speed of the algorithm. Therefore, this application changes the generation mechanism of the initial variable set in the original random frog-jumping method and proposes a wavelength variable redundancy description method based on information entropy. The initial variable set is generated based on the minimum redundancy method. This technique is used to improve the random frog-jumping algorithm, which can minimize the information redundancy of wavelength variables in spectral data from the initial stage.

[0081] (2) When applying the minimum redundancy variable strategy to determine the optimal wavelength variable, two main considerations are focused on: the redundancy between wavelength variables and the correlation between spectral information and target components. The smaller the redundancy between wavelength variables, the less similarity and redundant information there is, and the lower the degree of multicollinearity between variables. The improved random frog jumping method controls this aspect by modifying the initial variable set selection method of the original random frog jumping algorithm. The greater the correlation between spectral information and target components, the greater the proportion of effective information components in the spectral data. The improved random frog jumping method controls this aspect through the subsequent operations of the original random frog jumping algorithm without modification.

[0082] (3) Considering that information entropy is an effective means of measuring the degree of uncertainty of random variables, and can be used mathematically to represent the concept of capturing the amount of information contained in a piece of information, without being bound by the strictly determined part of the information and the meaning that can be predicted by its internal structure, this application uses information entropy to estimate the redundancy of mutual information between wavelength variables in the spectrum, and the execution method is as follows.

[0083] Given spectral measurement data X m×n Reference value Y of the sample component being tested m×1 m is the number of samples, and n is the number of wavelength variables.

[0084] Calculate the Pearson correlation coefficient between wavelength variables (Formula (1)).

[0085]

[0086] Wherein, cov(x) i ,x j ) represents the wavelength variable x i and x j covariance, and For variable x i and x j Standard deviation, E(x) i ) and E(x j ) is the variable x i and x j The expected value of i,j=1,2,…,n, where n is the number of wavelength variables;

[0087] According to formula (1), the Pearson correlation coefficient ranges from [-1, 1], and its absolute value can be used as a measure of the correlation between two variables, as shown in Table 1.

[0088] Table 1. Measures of the degree of correlation between variables corresponding to Pearson correlation coefficients.

[0089]

[0090] According to Table 1, if the correlation coefficient between a wavelength variable and other wavelength variables is small, then the wavelength variable cannot be linearly represented by other wavelength variables. In this case, the wavelength variable must be retained as a key wavelength variable in the initial dataset; otherwise, it means that there may be multicollinearity between the wavelength variable and other wavelength variables, and it cannot be retained in the initial dataset. As for the method of determining the degree of correlation, the information entropy index described in formula (6) is used, and the first K0 variables are selected in descending order to form the initial variable set.

[0091] The method for determining the information entropy index is as follows.

[0092] Spectral data X m×n As a matrix, it is essentially a vector group containing n m-dimensional vectors, each vector corresponding to the absorbance value of the infrared spectrum at a corresponding wavelength position. Therefore, the correlation coefficient is also an n×n matrix, expressed in R0. n×n express.

[0093]

[0094] In the formula,

[0095] r ij =|ρ(x) i ,x j (2)

[0096] r ij =r ji (3)

[0097] r ii =1 (4)

[0098] If data X m×n After standardization, there are

[0099] r ij =|cov(x) i ,x j (5)

[0100] Because of R n×n It is an n×n matrix, and the statistical matrix elements r are... ij The probability of the value P(r) occurring ij The wavelength variable x is obtained according to formula (6), where i,j = 1, 2, ..., n. j The corresponding data information entropy H(x) jThe values ​​of (j = 1, 2, ..., n) can better help this application understand and interpret the changes and differences in spectral information corresponding to wavelength variables, thereby determining the degree of redundancy between variables.

[0101]

[0102] The specific signal cleansing method based on spectral analysis performed at the beginning of the spectral preprocessing stage is as follows:

[0103] Step 1: Perform s repeated measurements on the milk sample, and analyze the spectral data X obtained from each measurement. m×n Principal component analysis was performed to obtain the corresponding score matrix T. m×z and weight matrix P z×n , is represented as:

[0104] X m×n =T m×z P z×n ;

[0105] Step 2: Calculate the arithmetic mean function of the PCi scores of all principal components in the principal component analysis. Sum of standard deviation function and utilize and Obtain the mean square function of the PCi score for each principal component. Represented as:

[0106]

[0107] Where i = 1, 2, ..., z, z is the number of principal components in the principal component analysis, m is the number of samples, and n is the number of wavelength variables;

[0108] Step 3: [Regarding...] Perform a two-dimensional discrete Fourier transform to obtain And based on the frequency increment Δf, the frequency changes from f to f+Δf. Value, finally used Obtain the power spectral density function Represented as:

[0109]

[0110] Where f is the frequency of the spectral data change, and Δf is the frequency increment. It is the mean square value of the frequency range from f to f+Δf, i.e., the second-order raw moment;

[0111] Step 4: Determine the power spectral density function Are all elements in the same value? If the power spectral density function is equal... If all elements in the array are equal and constant, then white noise interference exists, and step 5 is executed; otherwise, step 6 is executed.

[0112] Step 5: Analyze the spectral data X obtained from s repeated measurements. m×n The arithmetic mean was taken as the new spectral test value X. m×n and the new spectral test data X m×n Principal component analysis was performed, followed by filtering out white noise interference to obtain spectral data X'. m×n and the spectral data matrix X' m×n Subsequent orthogonal scattering correction is performed to complete the preprocessing.

[0113] Spectral data X' m×n Represented as:

[0114] X' m×n =X m×n -T m×1 P 1×n

[0115] Among them, T m×1 The score matrix of principal component PCi, P 1×n The weight matrix for the PCi score;

[0116] Step 6: Analyze the spectral data X obtained from s repeated measurements. m×n The arithmetic mean was taken as the new spectral test value X. m×n and the new spectral test data X m×n Subsequent orthogonal scattering correction is performed to complete the preprocessing.

[0117] The concentration of components in the test sample set is determined using chemical analysis methods specified in national standards or using measuring instruments with higher precision. The determination results serve as reference values ​​for the concentration of sample components and RFP.

[0118] In spectral analysis, the spectral data of the test sample set undergoes spectral preprocessing, wavelength selection, and multivariate calibration model establishment. The resulting model is subsequently stored in a computer-controlled processing system. During model prediction and analysis, the system calls the model to perform corresponding model predictions on the test sample. Based on the predicted values ​​and reference values, the measurement results and their errors can be obtained.

[0119] In spectral analysis, a signal purification method based on spectrum analysis is proposed for spectral preprocessing to filter out white noise, represented by resistive thermal noise, from the spectrum. The implementation process, basic idea, and operating mechanism of this spectrum analysis-based signal purification method are as follows:

[0120] The first step is to select the spectral data obtained from the 1st, 2nd, ..., sth measurements from the repeated measurements, and perform principal component analysis on them in turn to obtain the corresponding scores and weights.

[0121] The basic idea and operating mechanism of the signal purification method based on spectrum analysis described in this application are explained in this section:

[0122] Noise in a circuit varies in intensity over time and at different locations, making it impossible to predict accurately; therefore, it is a random signal. Random signals objectively exist and obey statistical laws, thus being a major cause of random errors in measurement data. During the acquisition of sample spectra by spectrometers, to compensate for random errors and reduce their impact, the arithmetic mean m of multiple measurements of the measured quantity x under repeated measurement methods is typically used. x (t) represents the spectral test value, while σ is the standard deviation of the arithmetic mean of the measured data under repeated measurement conditions. x (t) describes the degree of dispersion of the influence of random error, where t is the measurement time.

[0123] Assume that in the repeated measurement method, each measurand is measured s times, where s represents the number of repeated measurements in spectral acquisition, typically taken as 10. From the obtained spectral measurements, the 1st, 2nd, ..., sth measurement data under the repeated measurement method are selected sequentially. Let each measurement data be spectral data X. m×n In essence, it is a two-dimensional matrix with dimensions m×n, where m represents the number of samples corresponding to the row vectors in the spectral data matrix, and n represents the number of wavelength variables corresponding to the column vectors in the spectral data matrix.

[0124] The spectral data X obtained from the first measurement m×n For example, principal component analysis is performed on it, as shown in formula (7), to obtain the corresponding score matrix T. m×z and weight matrix P z×n The score represents information at a certain level of the spectrum, and the weight represents the corresponding contribution ratio. Using conventional principal component analysis methods, we can obtain the first principal component (PC1), the second principal component (PC2), ..., the z-th principal component (PC...). z The score of each principal component (PC) is calculated, corresponding to the score of each PC. i The scores in the table are all two-dimensional matrices with dimension m×1. The symbol z represents the number of principal components in the principal component analysis, which is usually chosen to be 20 for dairy samples such as milk.

[0125] X m×n =T m×z P z×n (7)

[0126] According to formula (7), the principal component analysis of the subsequent second, third, ..., s-th measurement data is performed in the same manner.

[0127] The second step involves analyzing the spectral data from the repeated measurements (the 1st, 2nd, ..., sth measurements) to identify the corresponding principal components (PC1, PC2, ..., PC3) from the principal component analysis. z The scores of each principal component (PC) are calculated separately. i The arithmetic mean and standard deviation functions of the scores of s repeated measures (i = 1, 2, ..., z) are used, and each function value corresponds to a two-dimensional matrix of dimension m × 1. Each principal component PC is obtained according to formula (8). i The mean square function, the corresponding form of the function value is also a two-dimensional matrix with dimension m×1.

[0128] The basic idea and operating mechanism of the signal purification method based on spectrum analysis described in this application are explained in this section:

[0129] During the spectral acquisition process, as the measurement time t changes, the arithmetic mean function can describe the central trend of the spectral change, and the variance function can describe the degree of dispersion of the change. The sum of the two results in the square mean function (see formula (8)), which can reflect both the central trend and the degree of dispersion. Therefore, it can reflect the law of the change of spectral intensity of a specific sample at a specific wavelength with time.

[0130] ψ x 2 (t)=m x 2 (t)+σ x 2 (t) (8)

[0131] In the formula, m x (t) represents the first-order raw moment of the data x, which is also the mean, σ x 2 (t) is the variance function of the data x, which is the second central moment.

[0132] In near-infrared spectroscopy analysis, common preprocessing methods analyze the information contained in a static spectrum. However, the intensity of noise in the instrument circuit varies with time and location. To expose its influence and reduce or eliminate it based on its mechanism, we can start from the dynamic spectral acquisition process that changes over time. By using repeated measurement data, we can perform corresponding time-domain and frequency-domain analysis. Based on this, this invention proposes a signal purification method based on spectrum analysis. It introduces a frequency-domain spectral density function index on the basis of time-domain signal intensity analysis to measure the distribution of signal intensity along the frequency axis, thereby exposing the influence of random noise.

[0133] Under repeated measurement conditions, the spectrometer is operated to sample spectra at regular intervals, and the principal components PC are calculated. i The mean square function of the score matrix (i = 1, 2, ..., z) See formula (9).

[0134]

[0135] In the formula, PC for spectral data i The mean function, PC for spectral data i The variance function.

[0136] The third step is to take the two-dimensional discrete Fourier transform of the mean square function of each principal component PCi obtained by formula (9), and then calculate the corresponding power spectral density function according to formula (4).

[0137] The basic idea and operating mechanism of the signal purification method based on spectrum analysis described in this application are explained in this section:

[0138] PC of spectral data i The score is viewed as a random process that varies with the spectral acquisition and measurement time. The mean square function is an index describing the intensity in the time domain. If described in the frequency domain, the spectrum of the mean square function is expressed as the mean square value in the range from f to f+Δf. To describe this, when Δf has a certain width, the mean square value within the range of Δf may vary. Therefore, we take the average mean square value within the range of Δf to describe it, i.e., the power spectral density function. The calculation is shown in formula (10). The power spectral density function can represent the distribution of power on the frequency axis.

[0139]

[0140] In the formula, f is the frequency of the spectral data change, and Δf is the frequency increment. The power spectral density function is the mean square value over the frequency range from f to f+Δf, which is also the second-order raw moment. A two-dimensional matrix with dimension m×1.

[0141] The fourth step is to process each principal component PC. i power spectral density function If all m values ​​in the corresponding matrix are equal to constants, then the principal component PC is identified. i This represents white noise interference such as resistive thermal noise.

[0142] The basic idea and operating mechanism of the signal purification method based on spectrum analysis described in this application are explained in this section:

[0143] In frequency domain analysis, noise with a constant power spectral density is typically referred to as white noise. During spectral acquisition, the power spectral density of resistive thermal noise in the spectrometer is a constant independent of frequency, thus also falling under the category of white noise. Utilizing this characteristic of white noise, the principal component scores representing a certain level of spectral information are calculated. After a two-dimensional Fourier transform, its power spectral density is calculated, and the index value is used for judgment, thereby achieving signal purification based on spectral analysis and reducing the impact of white noise such as resistive thermal noise on the spectrum.

[0144] The fifth step is to process the spectral data X obtained from s repeated measurements. m×n After taking the arithmetic mean, the new spectral test data is used as the new spectral test data. Principal component analysis is then performed on the new spectral test data. The influence of the principal component PCi corresponding to the white noise interference is then removed by its weight, as shown in formula (11), to obtain the spectral data X'. m×n and the spectral data matrix X' m×n Subsequent orthogonal scattering correction is performed to complete the preprocessing.

[0145] Spectral data X' m×n Represented as:

[0146] X' m×n =X m×n -T m×1 P 1×n (11)

[0147] Among them, T m×1 The score matrix of principal component PCi, P 1×n The weight matrix of the principal component PCi;

[0148] The specific steps for monitoring the metabolic status of dairy cows based on RFP are as follows:

[0149] When RFP < 1.0, it is an abnormal result, indicating subclinical acidosis;

[0150] When 1.0≤RFP≤1.5, it is a normal result, indicating a balance of positive energy;

[0151] When 1.5 < RFP ≤ 2.0, it is an abnormal result, indicating a negative energy balance;

[0152] When RFP > 2.0, it is an abnormal result, indicating a subclinical ketosis index in negative energy balance, and there is an increased risk of postpartum disease in animals in early lactation.

[0153] The increased risk of postpartum diseases in animals during early lactation includes retained placenta, left abomasal displacement, endometritis, and clinical endometritis.

[0154] The neural network is a BP neural network.

[0155] Backpropagation (BP) artificial neural networks are a paradigm among artificial neural networks due to their multi-layered structure and feedforward characteristics. They are not only simple in structure but also powerful in function, with excellent nonlinear mapping and wide adaptability, and are easy to implement.

[0156] In the context of rapid digital information development, precision livestock farming requires key technological innovations that consider all aspects related to dairy farms, from building structure, environmental control, livestock wastewater removal, treatment and storage, milking, individual milk yield and quality control, to individual animal identification. All these aspects are monitored through sensors designed to acquire the "raw" data of interest, which must be managed and stored before access. The current challenge is to automatically, quickly, and accurately acquire the largest amount of data and use machine learning to model, analyze, and predict massive amounts of data. Both of these learning methods are based on the development of artificial neural networks. Therefore, developing and researching multivariate calibration model building methods based on neural networks is an essential tool in the computer information age, applicable to increasingly automated, precise, and accurate farm management. Backpropagation (BP) neural networks, as a form of machine learning, exhibit stronger learning capabilities and better predictive abilities with a larger number of typical samples, making them suitable for large-scale dairy farms operating under a product-plus-feed (PLF) model.

[0157] Backpropagation (BP) neural networks, as a type of multilayer feedforward neural network, use the backpropagation algorithm to update network weights and biases to minimize the error between the network's predicted output and the actual output. When establishing multivariate correction models, BP neural networks can handle and model complex nonlinear relationships. Through multiple neurons in its hidden layers, they can capture complex patterns and interactions in the data, thus providing strong data fitting capabilities. This application uses it for near-infrared spectral modeling and prediction of dairy cow metabolic status. As a machine learning approach, it has significant application value in the rapid monitoring of large-scale farming in today's rapidly developing precision animal husbandry industry.

[0158] The white noise interference is resistive thermal noise interference.

[0159] The fat and protein concentrations were determined using chemical analysis methods specified in national standards or using measuring instruments with higher precision.

[0160] A method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis is proposed. This method involves acquiring and analyzing near-infrared spectral data of milk samples to determine radioactive precipitates (RFPs), thereby identifying the energy balance status of dairy cows during the feeding process and providing monitoring results for subclinical ketosis and subclinical acidosis. This monitoring method is of practical significance for reducing the cost of rapid milk analysis at dairy processing or sales sites and for real-time monitoring of the health and physiological state of dairy farm populations or individual cows.

[0161] To better meet the automated and batch testing needs of dairy cow breeding management in the development of precision livestock farming (PLF) in the digital information age, and to provide real-time feedback on milk component index test results during milking parlors, dairy processing, or sales, this application proposes a near-infrared spectroscopy analysis technique for monitoring the metabolic state of dairy cows. This technique is applied to various stages of the milk processing chain, including milking parlors, raw milk testing, routine offline analysis, and quality inspection of finished dairy products. This approach not only provides strong technical support for the development of precision livestock farming but also has the potential for widespread application in the field of component analysis, possessing broad market prospects.

[0162] It should be noted that the specific embodiments are merely explanations and illustrations of the technical solution of the present invention and should not be used to limit the scope of protection. Any modifications made in accordance with the claims and specification of the present invention that are only partial should still fall within the protection scope of the present invention.

Claims

1. A method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis, characterized in that... Includes the following steps: The process involves acquiring real-time milk samples from the cows to be monitored, using a trained neural network to obtain the RFP (Real-Time Feedback) of the milk samples, and finally monitoring the metabolic status of the cows based on the RFP. A trained neural network is obtained through the following steps: Step 1: Obtain milk samples and acquire near-infrared spectral data from the milk samples to obtain spectral data; Step 2: Center the spectral data; Step 3: Preprocess the standardized spectral data to filter out noise; Step 4: Filter the wavelength variables in the preprocessed spectral data; Step 5: Extract the fat concentration and protein concentration from the milk sample, and then obtain the ratio of fat concentration to protein concentration, i.e., RFP. Finally, use the screened spectral data as input and RFP as output to train the neural network. The specific steps for obtaining the RFP of milk samples produced in real time by the cow under monitoring using a trained neural network are as follows: The milk samples produced in real time by the cows to be monitored are processed in steps one through four to obtain the filtered spectral data. The filtered spectral data is then input into the trained neural network to obtain the output RFP.

2. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 1, characterized in that... The wavelength variable selection was performed using a random frog-jumping method.

3. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 2, characterized in that... The random frog jumping method is an improved random frog jumping method. In the improved random frog jumping method, the initial variable set is obtained through the following steps: Obtain the wavelength variables from the spectral data, and calculate the Pearson correlation coefficient ρ(x) between the wavelength variables respectively. i ,x j ), represented as: Wherein, cov(x) i ,x j ) represents the wavelength variable x i and x j covariance, and For variable x i and x j Standard deviation, E(x) i ) and E(x j ) is the variable x i and x j The expected value of i,j=1,2,…,n, where n is the number of wavelength variables; Obtain the information entropy index for each Pearson correlation coefficient, and select the top K0 variables in descending order to form the initial variable set. The information entropy index H(x) of the Pearson correlation coefficient is... j ) is represented as: Where, r kj r is an intermediate variable kj =|ρ(x) i ,x j )|, K0 is a random number between 1 and n, P(r kj ) is r kj The frequency of.

4. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 3, characterized in that... The specific preprocessing steps in step three are as follows: The spectral data is processed sequentially using a signal sanitization method based on spectral analysis and an orthogonal scattering correction method, specifically as follows: Step 1: Perform s repeated measurements on the milk sample, and analyze the spectral data X obtained from each measurement. m×n Principal component analysis was performed to obtain the corresponding score matrix T. m×z and weight matrix P z×n , represented as: X m×n =T m×z P z×n ; Step 2: Calculate the arithmetic mean function of the PCi scores of all principal components in the principal component analysis. Sum of standard deviation function and utilize and Obtain the mean square function of the PCi score for each principal component. Represented as: Where i = 1, 2, ..., z, z is the number of principal components in the principal component analysis, m is the number of samples, and n is the number of wavelength variables; Step 3: [Regarding...] Perform a two-dimensional discrete Fourier transform to obtain And based on the frequency increment Δf, the frequency changes from f to f+Δf. Value, finally used Obtain the power spectral density function Represented as: Where f is the frequency of the spectral data change, and Δf is the frequency increment. It is the mean square value of the frequency range from f to f+Δf, i.e., the second-order raw moment; Step 4: Determine the power spectral density function Are all elements in the same value? If the power spectral density function is equal... If all elements in the array are equal and constant, then white noise interference exists, and step 5 is executed; otherwise, step 6 is executed. Step 5: Analyze the spectral data X obtained from s repeated measurements. m×n After taking the arithmetic mean, the new spectral test data is used as the new spectral test data. Principal component analysis is then performed on the new spectral test data, and white noise interference is filtered out to obtain the spectral data X'. m×n and the spectral data matrix X' m×n Perform orthogonal scattering correction to complete the preprocessing. Spectral data X' m×n Represented as: X’ m×n =X m×n -T m×1 P 1×n Among them, T m×1 The score matrix of principal component PCi, P 1×n The weight matrix of the principal component PCi; Step 6: Analyze the spectral data X obtained from s repeated measurements. m×n The arithmetic mean was taken as the new spectral test value X. m×n And for the new spectral test data X m×n Orthogonal scattering correction is performed to complete the preprocessing.

5. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 1, characterized in that... The specific steps for monitoring the metabolic status of dairy cows based on RFP are as follows: When RFP < 1.0, it is an abnormal result, indicating subclinical acidosis; When 1.0≤RFP≤1.5, it is a normal result, indicating a balance of positive energy; When 1.5≤RFP≤2.0, it is an abnormal result, indicating a negative energy balance; When RFP > 2.0, it is an abnormal result, indicating a subclinical ketosis index in negative energy balance, and there is an increased risk of postpartum disease in animals in early lactation.

6. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 5, characterized in that... The increased risk of postpartum diseases in animals during early lactation includes retained placenta, left abomasal displacement, endometritis, and clinical endometritis.

7. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 1, characterized in that... The neural network is a BP neural network.

8. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 4, characterized in that... The white noise interference is resistive thermal noise interference.

9. The method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis according to claim 1, characterized in that... The fat and protein concentrations were determined using chemical analysis methods specified in national standards or using measuring instruments with higher precision.