Dairy cow metabolism state monitoring method based on near infrared spectrum analysis

By using near-infrared spectroscopy analysis technology and neural networks to monitor the metabolic status of dairy cows in dairy farms, the problem of inactivity monitoring of the metabolic status of dairy cows in the existing technology is solved, and real-time monitoring and management of the health and physiological status of dairy cows is achieved.

CN119438126AActive Publication Date: 2025-02-14HARBIN UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411501057.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-14
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

In the prior art, the monitoring of the metabolic status of dairy cows is not real-time and real-time information on the health and physiological status of dairy cows cannot be provided in time.

Method used

Using near-infrared spectroscopy analysis method, the milk samples produced in real time by obtaining the milk samples to be monitored, and the spectral data of the milk samples are obtained using the trained neural network, and the centralization, standardization, pretreatment and wavelength variable screening are performed to extract fat concentration. The ratio of protein concentration (RFP) is used to monitor the metabolic status of dairy cows.

Benefits of technology

It realizes online real-time monitoring of the metabolic status of dairy cows, and can provide timely information on the health and physiological status of dairy cows to meet the automated and batch testing needs of animal breeding management in precise animal husbandry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119438126A_ABST
    Figure CN119438126A_ABST
Patent Text Reader

Abstract

The invention discloses a dairy cow metabolism state monitoring method based on near infrared spectrum analysis, relates to the field of dairy cow nutrition metabolism state monitoring and a biomacromolecule component analysis technology, and aims to solve the problem that the existing dairy cow metabolism state monitoring is not real-time monitoring. According to the method, the RFP is measured, and the metabolic state of the dairy cow is identified by using the RFP, so that the milk sample is not monitored in an off-line mode, but is monitored on line in real time, and the real-time monitoring result of the health and physiological state of animals in the breeding process of a farm is given; and therefore, the automatic and batch detection requirements of animal breeding management in precise animal husbandry development in the digital information era can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of dairy cow nutritional metabolic state monitoring and biomacromolecule component analysis technology, and specifically to a dairy cow metabolic state monitoring method based on near-infrared spectroscopy analysis. Background Art

[0002] Based on the analysis of industrial development trends, digital technology in the information age has the momentum to gradually transform all industries. Under this situation, most companies at home and abroad are more or less facing problems in technology updates, transformation or digital upgrades. As an emerging technology, precision livestock farming (PLF) has developed rapidly in recent years and has shown a trend that affects the entire livestock industry and its testing and analysis fields, ranging from cattle and pigs to poultry. Among them, dairy farming is one of the areas that is currently most affected by it. As precision livestock farming has the potential to obtain greater profits and improve animal welfare, its development is in the ascendant.

[0003] In line with the above 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, which can provide dairy farmers with information about the milk characteristics and physiological condition of each cow. It is not only conducive to 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] NIR analysis technology studies the physical and chemical properties of samples in a non-destructive way. It combines fiber optic diffuse reflectance technology and near-infrared spectroscopy analysis methods to develop portable near-infrared spectroscopy instruments that can be directly used in dairy milking parlors, milk purchases, or dairy product sales sites, thereby achieving simultaneous prediction of multiple parameters of material composition. Compared with other laboratory technologies, this technology has the advantages of being fast, non-destructive, portable, and cost-effective. The above characteristics have made near-infrared spectroscopy analysis technology widely accepted in recent years, and it is expected to become one of the most promising methods in the field of composition analysis of macromolecular substances such as dairy products.

[0005] According to standard dairy practice, cows are milked two to three times a day, which means that milk samples from the milking parlor provide real-time information on the current status of the herd and individuals. Regular collection and analysis of these sample spectral information can provide real-time understanding of the chemical composition of milk without adversely affecting the daily life of the animals, and can also reduce the cost of regular milk analysis. In recent years, most near-infrared spectroscopy analysis studies have been conducted on milk samples in offline mode, or more precisely, not directly in the milking parlor. Therefore, the monitoring results of the metabolic status of dairy cows in the prior art are not real-time. Summary of the invention

[0006] The purpose of the present invention is to propose a method for monitoring the metabolic state of dairy cows based on near infrared spectroscopy analysis in view of the problem that the existing monitoring of the metabolic state of dairy cows is not real-time monitoring.

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

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

[0009] Obtain the real-time milk samples produced by the monitored cows, and use the trained neural network to obtain the RFP of the real-time milk samples produced by the monitored cows, and finally monitor the metabolic status of the cows according to the RFP;

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

[0011] Step 1: obtaining a milk sample, and collecting near infrared spectral data of the milk sample to obtain spectral data;

[0012] Step 2: Centralize the spectral data;

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

[0014] Step 4: Screen the wavelength variables of the preprocessed spectral data;

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

[0016] The specific steps of using the trained neural network to obtain the RFP of the milk sample produced in real time by the monitored cow are as follows:

[0017] The milk sample produced in real time by the monitored dairy cow is processed from step one to step four to obtain screened spectral data, and the screened spectral data is input into the trained neural network to obtain the output RFP.

[0018] Furthermore, the wavelength variable screening is performed by a random frog leaping method.

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

[0020] Get the wavelength variables of the spectral data and calculate the Pearson correlation coefficient ρ(x i ,xj ), expressed as:

[0021]

[0022] Among them, cov(x i ,x j ) is the wavelength variable x i and x j The covariance of and For variable x i and x j The standard deviation, E(x i ) and E(x j ) is the variable x i and x j The mathematical expectation of , i,j=1,2,…,n, n is the number of wavelength variables;

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

[0024]

[0025] Among them, r kj is the intermediate variable, r 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 steps of preprocessing in step 3 are as follows:

[0027] The spectral data are processed in sequence using the signal purification method based on spectrum analysis and the orthogonal scatter correction method, specifically:

[0028] Step 1: Repeat the measurement of the milk sample s times and calculate the spectral data X obtained from each measurement. m×n Perform principal component analysis to obtain the corresponding score matrix T m×z and the weight matrix P z×n , expressed as:

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

[0030] Step 2: Calculate the arithmetic mean function of the PCi scores in all principal component analyses and standard deviation function And use and Get the square mean function of each principal component PCi score It is expressed as:

[0031]

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

[0033] Step 3: Right Perform a two-dimensional discrete Fourier transform and get And according to the frequency increment Δf, the frequency changes from f to f+Δf Value, finally used Get the power spectral density function It is expressed as:

[0034]

[0035] Where f is the frequency of spectral data change, Δf is the frequency increment, It is the square mean value in the frequency range from f to f+Δf, that is, the second-order origin moment;

[0036] Step 4: Determine the power spectral density function Are all elements in equal? ​​If the power spectral density function When the elements in are equal and constant, there is white noise interference, and step 5 is executed; otherwise, step 6 is executed;

[0037] Step 5: The spectral data X obtained by repeated measurement of s times m×n After taking the arithmetic mean, it is used as the new spectrum test value data, and the new spectrum test value data is subjected to principal component analysis, and then the white noise interference is filtered out to obtain the spectrum data X' m×n , and the spectral data matrix X' m×n Perform orthogonal scatter correction and complete preprocessing.

[0038] Spectral data X' m×n It is expressed as:

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

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

[0041] Step 6: The spectral data X obtained by repeated measurement of s times m×n After taking the arithmetic mean, it is used as the new spectrum test value data X m×n , and the new spectrum test value data X m×n Perform orthogonal scatter correction to complete preprocessing.

[0042] Furthermore, the specific steps of monitoring the metabolic status of dairy cows according to RFP are:

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

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

[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 subclinical ketosis in negative energy balance and an increased risk of postpartum disease in animals in early lactation.

[0047] Furthermore, the increased risk of postpartum diseases in animals in early lactation include retained placenta, displaced left abomasum, endometritis and clinical endometritis.

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

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

[0050] Furthermore, the fat concentration and protein concentration are measured by chemical analysis methods specified in national standards or by measuring instruments with a higher level of precision.

[0051] The beneficial effects of the present invention are:

[0052] This application performs near-infrared spectroscopy analysis on milk samples from the milking parlor of a dairy farm, determines RFP, and uses RFP to identify the metabolic status of the cows. Therefore, this application does not monitor milk samples in an offline mode, but rather monitors online in real time, thereby providing real-time monitoring results of animal health and physiological status during the breeding process on the farm, thereby meeting the needs for automated and batch testing of animal breeding management in the development of precision animal husbandry in the digital information age. BRIEF DESCRIPTION OF THE DRAWINGS

[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 purification method based on spectrum analysis in this application;

[0055] Figure 3 This is a schematic diagram of the composition of the principal component score matrix of this application. DETAILED DESCRIPTION

[0056] It should be particularly noted that, in the absence of conflict, the various embodiments disclosed in this application can be combined with each other.

[0057] Specific implementation method 1: refer to Figure 1 Specifically describing this embodiment, a method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis described in this embodiment comprises the following steps:

[0058] Obtain the real-time milk samples produced by the monitored cows, and use the trained neural network to obtain the RFP of the real-time milk samples produced by the monitored cows, and finally monitor the metabolic status of the cows according to the RFP;

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

[0060] Step 1: obtaining a milk sample, and collecting near infrared spectral data of the milk sample to obtain spectral data;

[0061] Step 2: Centralize the spectral data;

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

[0063] Step 4: Screen the wavelength variables of the preprocessed spectral data;

[0064] Step 5: Extract the fat concentration and protein concentration in the milk sample, and then obtain the ratio of fat concentration to protein concentration, namely RFP (ratio offat to protein). Finally, use the screened spectral data as input and RFP as output to train the neural network.

[0065] The specific steps of using the trained neural network to obtain the RFP of the milk sample produced in real time by the monitored cow are as follows:

[0066] The milk sample produced in real time by the monitored dairy cow is processed through steps one to four to obtain screened spectral data, and the screened spectral data is input into the trained neural network to obtain the output RFP.

[0067] The milk spectral data collection in the method of identifying the metabolic state of dairy cows uses a near-infrared spectrometer to test the near-infrared spectrum of the sample under test using optical fiber. Since the fat and protein substances in milk are biological macromolecules, their molecules can interact with near-infrared light to produce near-infrared absorption and scattering. The milk medium under test has high scattering and high optical density characteristics, and the corresponding structure and composition information of the sample under test are richly reflected in its diffuse reflected light. Based on this, the diffuse reflection optical measurement method can be used to measure the near-infrared spectrum of milk. At the same time, the use of optical fiber measurement can further improve the simplicity and portability of the test, making real-time and rapid detection of liquid samples, industrial equipment logistics, etc. extremely convenient.

[0068] The application of NIR spectroscopy to precision livestock farming (PLF) systems in feedlots is not only economically feasible, but also the fiber-optic portable method of using NIR diffuse reflectance spectroscopy can avoid the long wait for laboratory analysis responses, allowing timely intervention and prevention. It can be used directly on the dairy farm, and through the two modes of "online" or "real-time", it can obtain information in real time, correct interventions, and perform countless self-controlled analyses.

[0069] In the process of near-infrared spectral analysis, the effect of the molecules of the measured material components and the near-infrared spectral band mainly comes from the combined frequency absorption and the double frequency absorption, the absorption band is wide and seriously overlapped, and in the process of spectrum acquisition, the light source and optical path, power supply and circuit components will produce time drift, temperature drift, stray light, resistance thermal noise and other effects when the spectral instrument is running. Many influences make the near-infrared spectrum components carrying the above noise information and the concentration information of the measured sample components complex and the spectrum overlaps. The process of extracting useful sample information from the spectrum and filtering out noise is as difficult as "panning for gold in the sand". Therefore, before spectral modeling, spectral preprocessing must be performed to filter out noise and extract useful information. Furthermore, the full spectrum wavelength variables in the near-infrared range participate in modeling, which will lead to too many information-free variables, thereby increasing the test time, reducing the test efficiency and the model prediction accuracy, and there are multicollinearity problems in the modeling process of wavelength variables in full spectrum analysis. Therefore, after spectral preprocessing, wavelength variables must be screened before modeling. Therefore, at the beginning stage of spectral preprocessing, this application proposes a signal purification method based on spectrum analysis for spectral preprocessing, which is used to eliminate the influence of white noise represented by resistor thermal noise on the spectrum; at the pre-spectral modeling stage, this application uses the random frog leaping method to screen the wavelength variables of spectral data, so as to extract key characteristic wavelengths from complex multi-spectral data to achieve data dimensionality reduction, and can select effective information in the spectrum to a greater extent, thereby improving the signal-to-noise ratio of the modeling data.

[0070] The present application collects and analyzes near infrared spectroscopy data of milk samples to determine RFP, thereby identifying the energy balance state in the process of dairy cow feeding and providing monitoring results of subclinical ketosis and subclinical acidosis. The monitoring method has practical significance for reducing the cost of rapid analysis of milk at the dairy processing or sales site, and real-time monitoring of the health and physiological state of a group or a single dairy cow in a farm.

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

[0072] Get the wavelength variables of the spectral data and calculate the Pearson correlation coefficient ρ(x i ,x j ), expressed as:

[0073]

[0074] Among them, cov(x i ,x j ) is the variable x i and x j The covariance of and For variable x i and x j The standard deviation, E(x i ) and E(x j ) is the variable x i and x j The mathematical expectation of , i,j=1,2,…,n, n is the number of wavelength variables;

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

[0076]

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

[0078] The near infrared spectrum contains a large amount of information that is irrelevant to the measured value. In order to effectively extract the measured component information, in the near infrared spectrum analysis process, it is generally necessary to pre-process the original spectrum of the sample first, and then perform wavelength screening to reduce the interference of the spectrum and improve the model prediction performance. The improved random frog leaping method described in this application is an improved random frog leaping method based on minimum redundancy. As an emerging sub-heuristic population intelligent optimization algorithm in the field of evolutionary computing, the biggest advantage of the random frog leaping (RF) method is that the concept is simple, easy to implement, and has a strong global search capability. However, for the near infrared spectrum of multi-component suspended translucent liquids such as milk, simply relying on the original random frog leaping algorithm to randomly generate an initial data set to implement wavelength screening, there are the disadvantages of not very fast convergence speed and easy to fall into local extreme values. For this reason, the present application creatively proposes an improved random frog leaping method, which is based on the minimum redundancy generation method of spectral wavelength variables based on information entropy. By obtaining the information entropy index of the wavelength variable, the wavelength variables of the random frog leaping initial data set are screened out, thereby starting from the variable population as the initial seed, that is, implementing minimum redundancy processing, and then eliminating the multicollinearity problem between variables.

[0079] The main idea of ​​the improved random frog leaping method for spectral wavelength variable screening and its key technologies for implementation are as follows:

[0080] (1) Analyze the original random frog leaping algorithm, which mainly uses the reversible jump Markov chain Monte Carlo algorithm to establish a mathematically simple and computationally efficient characteristic wavelength selection algorithm. A pseudo MCMC chain is obtained by implementing fixed-dimensional and cross-dimensional mobile searches in the model space to calculate the probability of selection of each characteristic variable as the criterion for selecting the characteristic variable; when using it to extract characteristic variables, since the initial variable set is randomly extracted from the original data set, useless or interfering wavelength variables may be introduced, which increases the degree of multicollinearity between variables, thereby reducing the prediction ability and convergence speed of the algorithm. Therefore, this application changes the generation mechanism of the initial variable set in the original random frog leaping method, proposes a wavelength variable redundancy description method based on information entropy, generates an initial variable set based on the minimum redundancy method, and uses this technology to improve the random frog leaping algorithm, which can minimize the information redundancy of the wavelength variables of spectral data from the initial stage.

[0081] (2) When applying the minimum redundant variable strategy to determine the optimal wavelength variable, the focus is on two aspects: one is the redundancy between wavelength variables; the other is the correlation between spectral information and target components. The smaller the redundancy between wavelength variables, the smaller the similarity between wavelength variables, the less repeated information, and the lower the multicollinearity between variables. The control of this link by the improved random frog leaping method is to modify the selection method of the initial variable set of the original random frog leaping algorithm; the greater the correlation between spectral information and target components, the greater the proportion of effective information components in spectral data information. The control of this link by the improved random frog leaping method is achieved through the subsequent operations of the original random frog leaping algorithm without modification.

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

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

[0084] The Pearson correlation coefficient between the wavelength variables was calculated (Formula (1)).

[0085]

[0086] Among them, cov(x i ,x j ) is the wavelength variable x i and x j The covariance of and For variable x i and x j The standard deviation, E(x i ) and E(x j ) is the variable x i and x j The mathematical expectation of , i,j=1,2,…,n, n is the number of wavelength variables;

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

[0088] Table 1 Pearson correlation coefficient corresponding to the degree of correlation between variables

[0089]

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

[0091] The information entropy index is determined by the following method.

[0092] Spectral DataX m×n As a matrix, it is essentially a vector group containing n m-dimensional vectors, each of which corresponds to the absorbance value of the infrared spectrum at the corresponding wavelength position. Therefore, the correlation coefficient is also a matrix with a dimension of n×n, expressed by R 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 the data X m×n After standardization,

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

[0100] Due to R n×n is a matrix of dimension n×n, counting matrix point element r ij The probability of a value occurring is P(r ij ) value, (i,j=1,2,…,n), and obtain the wavelength variable x according to formula (6): j The corresponding data information entropy H(x j) value, (j=1,2,…,n), whose value can better help the present application understand and explain the changes and differences in the spectral information corresponding to the wavelength variables, thereby determining the degree of redundancy between the variables.

[0101]

[0102] The signal purification method based on spectrum analysis performed at the beginning of the spectrum preprocessing is as follows:

[0103] Step 1: Repeat the measurement of the milk sample s times and calculate the spectral data X obtained from each measurement. m×n Perform principal component analysis to obtain the corresponding score matrix T m×z and the weight matrix P z×n , expressed as:

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

[0105] Step 2: Calculate the arithmetic mean function of the PCi scores in all principal component analyses and standard deviation function And use and Get the square mean function of each principal component PCi score It is expressed as:

[0106]

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

[0108] Step 3: Right Perform a two-dimensional discrete Fourier transform and get And according to the frequency increment Δf, the frequency changes from f to f+Δf Value, finally used Get the power spectral density function It is expressed as:

[0109]

[0110] Where f is the frequency of spectral data change, Δf is the frequency increment, It is the square mean value in the frequency range from f to f+Δf, that is, the second-order origin moment;

[0111] Step 4: Determine the power spectral density function Are all elements in equal? ​​If the power spectral density function When the elements in are equal and constant, there is white noise interference, and step 5 is executed; otherwise, step 6 is executed;

[0112] Step 5: The spectral data X obtained by repeated measurement of s times m×n After taking the arithmetic mean, it is used as the new spectrum test value data X m×n , and the new spectrum test value data X m×n Perform principal component analysis, then filter out the white noise interference to obtain the spectral data X' m×n , and the spectral data matrix X' m×n Perform subsequent orthogonal scatter correction to complete preprocessing.

[0113] Spectral data X' m×n It is expressed as:

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

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

[0116] Step 6: The spectral data X obtained by repeated measurement of s times m×n After taking the arithmetic mean, it is used as the new spectrum test value data X m×n , and the new spectrum test value data X m×n Perform subsequent orthogonal scatter correction to complete the preprocessing.

[0117] The component concentrations of the test sample set are determined using chemical analysis methods specified in national standards or using measuring instruments with a higher level of precision, and the measurement results are used as reference values ​​for the sample component concentrations and RFP.

[0118] In spectral analysis, spectral preprocessing, spectral wavelength screening and multivariate correction model establishment are performed on the spectral data of the test sample set, and the obtained model will be stored in the computer control processing system later. During model prediction and analysis, the system calls the model to perform corresponding model prediction on the sample to be tested, and the measurement results and their errors can be obtained based on the obtained prediction values ​​and reference values.

[0119] In spectral analysis, a signal purification method based on spectrum analysis is proposed for spectrum preprocessing to filter out the influence of white noise represented by resistor thermal noise in the spectrum. A signal purification method based on spectrum analysis, its implementation process, basic idea and operation mechanism are as follows:

[0120] In the first step, the spectral data obtained from the first, second, ..., sth measurements in the repeated measurement are selected, and principal component analysis is performed on them respectively to obtain corresponding scores and weights.

[0121] The signal purification method based on spectrum analysis described in this application, the basic idea and operation mechanism corresponding to this link are explained as follows:

[0122] The intensity of noise in the circuit varies from time to time and from place to place, and cannot be accurately predicted, so it is a random signal. Random signals exist objectively and obey statistical laws, so they are the main cause of random errors in measurement data. In the process of collecting sample spectra by spectrometers, in order to use the compensation of random errors to reduce their impact, the arithmetic mean m of multiple measurement values ​​of the measured x under repeated measurement is usually used. x (t) is the spectrum test value, and the standard deviation σ of the arithmetic mean of the measured data under repeated measurement conditions x (t), it describes the dispersion degree of random error influence, and t is the measurement time.

[0123] Assume that each measured object is measured s times in the repeated measurement mode, and the symbol s represents the number of repeated measurements of spectrum acquisition, which is usually 10 in the spectrum measurement process. From the spectrum measurement values ​​obtained after the measurement is completed, select the first measurement data, the second measurement data, ..., the sth measurement data of the spectrum in the repeated measurement mode in turn, and assume that each measurement data is the spectrum data X m×n , which is essentially a two-dimensional matrix with a dimension of m×n. The symbol m represents the number of samples corresponding to the row vector in the spectral data matrix, and the symbol n represents the number of wavelength variables corresponding to the column vector in the spectral data matrix.

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

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

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

[0127] In the second step, for the spectral data obtained from the first measurement, the second measurement, ..., the sth measurement obtained by repeated measurement, the first principal component (PC1), the second principal component (PC2), ..., the zth principal component (PC z ) and calculate the scores of each principal component PC i The arithmetic mean function and standard deviation function of the s-times repeated measurement of the score (i=1,2,…,z), each function value corresponds to a two-dimensional matrix with a dimension of m×1. According to formula (8), each principal component PC is obtained i The corresponding form of the function value is also a two-dimensional matrix with a dimension of m×1.

[0128] The signal purification method based on spectrum analysis described in this application, the basic idea and operation mechanism corresponding to this link are explained as follows:

[0129] During the spectrum acquisition process, as the measurement time t changes, the arithmetic mean function can describe the central trend of the spectrum change, and the variance function can describe the dispersion of the change. The square mean function obtained by adding the two (see formula (8)) can reflect both the central trend and the dispersion, and can therefore reflect the law of how the spectral intensity of a specific sample at a specific wavelength changes with time.

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

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

[0132] In near-infrared spectral analysis, commonly used preprocessing methods are to analyze the information contained in a static spectrum. The intensity of the noise in the instrument circuit varies from time to time and from place to place. In order to expose its influence and reduce or eliminate it according to its mechanism of action, we can start from the dynamic spectrum acquisition process that changes with time, and use repeated measurement data to perform corresponding time domain and frequency domain analysis. Based on this, the present invention proposes a signal purification method based on spectrum analysis, which introduces a frequency domain spectral density function indicator 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 run to sample the spectrum at regular intervals and calculate the principal component PC i The square mean function of the score matrix of (i=1,2,…,z) See formula (9).

[0134]

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

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

[0137] The signal purification method based on spectrum analysis described in this application, the basic idea and operation mechanism corresponding to this link are explained as follows:

[0138] Transfer spectral data to PC i The score is regarded as a random process that changes with the spectral acquisition measurement time. The square mean function is an indicator that describes the intensity from the time domain. If it is described from the frequency domain, the spectrum of the square mean function is the square mean in the range of f to f+Δf. To describe, when Δf has a certain width, the mean square value within the range of Δf may change. Therefore, the average mean square value within the range of Δf is used to describe, that is, the power spectral density function The calculation is shown in formula (10). The power spectrum density function can represent the distribution of power on the frequency axis.

[0139]

[0140] In the formula, f is the frequency of spectral data change, Δf is the frequency increment, is the square mean value in the frequency range from f to f+Δf, that is, the second-order origin moment, power spectral density function A two-dimensional matrix of dimension m-by-1.

[0141] The fourth step is to calculate the PC i The power spectral density function If all m values ​​in the corresponding matrix are equal to a constant, the principal component PC is identified. i It represents white noise interference such as resistor thermal noise.

[0142] The signal purification method based on spectrum analysis described in this application, the basic idea and operation mechanism corresponding to this link are explained as follows:

[0143] In frequency domain analysis, noise with a constant power spectral density is usually called white noise. In the process of spectrum acquisition, the power spectral density of the resistor thermal noise in the spectral instrument is a constant that is independent of frequency, so it belongs to white noise. Using the above characteristics of white noise, the principal component score representing a certain level of spectrum information is calculated, and its power spectral density is calculated after two-dimensional Fourier transform, and its index value is used for judgment, thereby realizing signal purification based on spectrum analysis, thereby reducing the influence of white noise such as resistor thermal noise on the spectrum.

[0144] The fifth step is to convert the spectral data X obtained by repeated measurement of s times into m×n After taking the arithmetic mean, it is used as the new spectrum test value data, and the principal component analysis is performed on the new spectrum test value data. Then, the influence of the principal component PCi corresponding to the white noise interference is removed by its weight, see formula (11), and the spectrum data X' is obtained. m×n , and the spectral data matrix X' m×n Perform subsequent orthogonal scatter correction to complete the preprocessing.

[0145] Spectral data X' m×n It is expressed as:

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

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

[0148] The specific steps of monitoring the metabolic status of dairy cows according to RFP are:

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

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

[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 subclinical ketosis in negative energy balance and an increased risk of postpartum disease in animals in early lactation.

[0153] Animals in early lactation are at increased risk for postpartum diseases including retained placenta, displaced left abomasum, endometritis, and clinical endometritis.

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

[0155] The BP artificial neural network has become a model of artificial neural networks with its multi-layer structure and feedforward characteristics. It is not only simple in structure, but also powerful in function, with excellent nonlinear mapping and wide adaptability, and is easy to implement.

[0156] The main technological innovation of precision animal husbandry farms under the rapid development of digital information must take into account all aspects related to dairy farms, from house structure, environmental control, removal, treatment and storage of livestock wastewater, milking, individual milk production and quality control, to the identification of individual animals. All these aspects are checked by sensors designed to obtain the "raw" data of interest, which must be managed and stored before they can be accessed. At present, the challenge is to be able to automatically, quickly and accurately obtain the most data, and use machine learning methods to model, analyze and predict massive data. Both of these learning methods are based on the development of artificial neural networks. Therefore, the development and research of multivariate correction model establishment methods based on neural networks are essential means in the computer information age, suitable for increasingly automated, precise and accurate farm management. As one of the machine learning methods, the BP neural network has a stronger model learning ability and a better corresponding prediction ability, which is suitable for large-scale dairy farms under the PLF mode.

[0157] As a multi-layer feedforward neural network, BP neural network uses back-propagation algorithm to update network weights and biases to minimize the error between network predicted output and actual output. When establishing a multivariate correction model, BP neural network is able to process and model complex nonlinear relationships. Through its multiple neurons in the hidden layer, it can capture complex patterns and interactions in the data, thereby providing powerful data fitting capabilities. This application uses it in near-infrared spectroscopy modeling and prediction for the metabolic status evaluation of dairy cows. As a machine learning method, it has promotion and application value in the rapid monitoring of large-scale breeding in the rapid development of precision animal husbandry today.

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

[0159] The fat concentration and protein concentration are measured by chemical analysis methods specified in national standards or by measuring instruments with a higher level of accuracy.

[0160] A method for monitoring the metabolic state of dairy cows based on near-infrared spectroscopy analysis, which collects and analyzes near-infrared spectral data of milk samples and determines RFP, thereby identifying the energy balance state during dairy cow feeding and providing monitoring results of subclinical ketosis and subclinical acidosis. The monitoring method has practical significance for reducing the cost of rapid analysis of milk at dairy processing or sales sites, and real-time monitoring of the health and physiological state of a group or individual dairy cows in a farm.

[0161] In order to better meet the needs of automated and batch testing of dairy cow breeding management in the development of precision animal husbandry (PLF) in the digital information age, real-time feedback of milk composition index test results in the milking parlor, dairy processing or sales process is carried out to monitor the health and physiological status of groups or individual dairy cows more timely, or adjust the dairy processing technology online to ensure the quality of corresponding dairy products. This application monitors the metabolic status of dairy cows based on near-infrared spectroscopy analysis technology, and applies the method to various links of the milk processing chain, including the milking parlor of the farm, the detection of raw milk, conventional offline analysis, and quality inspection of finished dairy products. It can not only provide strong technical support for the development of precision animal husbandry, but also is expected to be widely used in the field of component analysis, and has broad market application prospects.

[0162] It should be noted that the specific implementation is only an explanation and description of the technical solution of the present invention, and cannot be used to limit the scope of protection of the rights. Any partial changes made according to the claims and description of the present invention should still fall within the scope of protection of the present invention.

Claims

1. A method for monitoring the metabolic status of dairy cows based on near infrared spectroscopy analysis, characterized in that The following steps are involved: Obtain the real-time milk samples produced by the monitored cows, and use the trained neural network to obtain the RFP of the real-time milk samples produced by the monitored cows, and finally monitor the metabolic status of the cows according to the RFP; The trained neural network is obtained through the following steps: Step 1: obtaining a milk sample, and collecting near infrared spectral data of the milk sample to obtain spectral data; Step 2: Centralize the spectral data; Step 3: Preprocess the standardized spectral data to filter out noise; Step 4: Screen the wavelength variables of the preprocessed spectral data; Step 5: Extract the fat concentration and protein concentration in the milk sample, and then obtain the ratio of fat concentration to protein concentration, namely RFP. Finally, use the screened spectral data as input and RFP as output to train the neural network. The specific steps of using the trained neural network to obtain the RFP of the milk sample produced in real time by the monitored cow are as follows: The milk sample produced in real time by the monitored dairy cow is processed from step one to step four to obtain screened spectral data, and the screened spectral data is input into the trained neural network to obtain the output RFP.

2. The method for monitoring the metabolic status of dairy cows based on near infrared spectroscopy analysis according to claim 1, characterized in that The wavelength variable screening was performed by random leapfrog method.

3. The method for monitoring the metabolic status of dairy cows based on near infrared spectroscopy analysis according to claim 2, characterized in that The random frog leaping method is an improved random frog leaping method. In the improved random frog leaping method, the initial variable set is obtained by the following steps: Get the wavelength variables of the spectral data and calculate the Pearson correlation coefficient ρ(x i ,x j ), expressed as: Among them, cov(x i ,x j ) is the wavelength variable x i and x j The covariance of and For variable x i and x j The standard deviation, E(x i ) and E(x j ) is the variable x i and x j The mathematical expectation of , i,j=1,2,…,n, n is the number of wavelength variables; Obtain the information entropy index of each Pearson correlation coefficient, and select the first K0 variables in descending order to form the initial variable set. The information entropy index of the Pearson correlation coefficient H(x j ) is expressed as: Among them, r kj is the intermediate variable, r 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 status of dairy cows based on near infrared spectroscopy analysis according to claim 3, characterized in that The specific steps of pre-processing in step 3 are as follows: The spectral data are processed in sequence using the signal purification method based on spectrum analysis and the orthogonal scatter correction method, specifically: Step 1: Repeat the measurement of the milk sample s times and calculate the spectral data X obtained from each measurement. m×n Perform principal component analysis to obtain the corresponding score matrix T m×z and the weight matrix P z×n , expressed as: X m×n =T m×z P z×n ; Step 2: Calculate the arithmetic mean function of the PCi scores in all principal component analyses and standard deviation function And use and Get the square mean function of each principal component PCi score It is expressed as: Where i = 1, 2, ..., z, z is the number of principal components in principal component analysis, m is the number of samples, and n is the number of wavelength variables; Step 3: Right Perform a two-dimensional discrete Fourier transform and get And according to the frequency increment Δf, the frequency changes from f to f+Δf Value, finally used Get the power spectral density function It is expressed as: Where f is the frequency of spectral data change, Δf is the frequency increment, It is the square mean value in the frequency range from f to f+Δf, that is, the second-order origin moment; Step 4: Determine the power spectral density function Are all elements in equal? ​​If the power spectral density function When the elements in are equal and constant, there is white noise interference, and step 5 is executed; otherwise, step 6 is executed; Step 5: The spectral data X obtained by repeated measurement of s times m×n After taking the arithmetic mean, it is used as the new spectrum test value data, and the new spectrum test value data is subjected to principal component analysis, and then the white noise interference is filtered out to obtain the spectrum data X' m×n , and the spectral data matrix X' m×n Perform orthogonal scatter correction and complete preprocessing. Spectral data X' m×n It is expressed as: X’ m×n =X m×n -T m×1 P 1×n Among them, T m×1 is the score matrix of the principal component PCi, P 1×n is the weight matrix of the principal component PCi; Step 6: The spectral data X obtained by repeated measurement of s times m×n After taking the arithmetic mean, it is used as the new spectrum test value data X m×n , and the new spectrum test value data X m×n Perform orthogonal scatter correction to complete preprocessing.

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

6. The method for monitoring the metabolic status of dairy cows based on near infrared spectroscopy analysis according to claim 5, characterized in that Animals in early lactation are at increased risk for postpartum diseases including retained placenta, displaced left abomasum, endometritis, and clinical endometritis.

7. The method for monitoring the metabolic status 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 status of dairy cows based on near infrared spectroscopy analysis according to claim 4, characterized in that The white noise interference is resistor thermal noise interference.

9. The method for monitoring the metabolic status of dairy cows based on near infrared spectroscopy analysis according to claim 1, characterized in that The fat concentration and protein concentration are measured by chemical analysis methods specified in national standards or by measuring instruments with a higher level of accuracy.

Citation Information

Patent Citations

  • Method for rapidly detecting protein content in milk

    CN106153547A

  • Methods and formulations for reducing absorption of carbohydrates in a companion animal

    CN106686988A

  • Milk urea nitrogen detection system for cow health diagnosis

    CN118549370A

  • Method and apparatus for searching threshold number of somatic cells for diagnosing mastitis through near-infrared spectrometry

    JP2010112799A