Sheep face identity authentication method for full-life-cycle tracing of agricultural and pastoral individuals
Patent Information
- Application Number
- CN202511506866.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-30
AI Technical Summary
Existing facial recognition technologies suffer from declining accuracy throughout the entire life cycle of agricultural and pastoral individuals due to significant changes in facial structure. They are unable to effectively monitor changes in physiological state and assist in genetic breeding, and lack the quantification of dynamic characteristics.
A biological evolution model for each individual sheep was established. Facial structure state vectors were predicted based on the Kalman filter model. Identity was verified through residual vectors, and health monitoring and group early warning were carried out using physiological state deviation vectors. Dynamic phenotypic features were extracted for genetic evaluation.
It improves the accuracy and reliability of identity authentication, enables quantitative monitoring of physiological status and early warning of population health, and provides new genetic breeding basis.
Smart Images

Figure CN121438366A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of livestock management, and particularly relates to a sheep face identity authentication method for whole life cycle tracing of livestock individuals. BACKGROUND
[0002] In modern intensive and large-scale livestock breeding, accurate identity recognition and whole life cycle tracing of each livestock individual are key links for realizing precise feeding, health monitoring, breeding management and product tracing. Biological feature recognition technology, especially the recognition method based on facial images, is widely studied and applied due to its non-contact and easy-to-collect characteristics.
[0003] However, the existing facial recognition method usually adopts a static feature comparison strategy, that is, facial features of an individual at a certain moment are extracted and compared with registered features in a database. For goats, sheep and other livestock individuals, their growth process from childhood to adulthood is accompanied by continuous and significant changes in facial skeleton and contour, resulting in a huge difference in facial features collected at different life stages. Such changes make the method based on static comparison have a decreased accuracy when performing identity authentication for a long time span, and it is difficult to realize reliable whole life cycle tracing.
[0004] In addition, the existing technology usually regards the short-term physiological state changes caused by factors such as diseases, nutrition or stress as noise or interference affecting the stability of recognition, and the technical goal is to suppress the influence of these changes on feature expression. This processing method not only discards the health information contained in these physiological changes, but also makes the system unable to assess the health status of the individual synchronously, and even unable to provide a group health warning by analyzing the state changes of multiple individuals.
[0005] At the same time, in the field of genetic breeding, the evaluation of breeding stock mainly depends on traditional economic traits such as body weight and output, and static appearance assessment. The existing technology lacks effective means to quantify and utilize dynamic biological characteristics in the growth process of individuals, such as the stability of their growth pattern or the adaptability to environmental changes. Model parameters describing these dynamic processes are not utilized as a quantifiable genetic feature, limiting the scientificity and dimensionality of breeding decisions. SUMMARY
[0006] The present application aims to provide a sheep face identity authentication method for whole life cycle tracing of livestock individuals, which solves the problems that the existing technology based on static feature comparison is difficult to cope with the continuous appearance changes in the whole life cycle of individuals, simultaneously regards physiological state fluctuations as interference and ignores their health monitoring value, and cannot quantify the dynamic characteristics in the growth process of individuals to assist genetic breeding.
[0007] To achieve the above object, the present application provides a sheep face identity authentication method for tracing the whole life cycle of individual sheep. The method comprises the following steps: S1, for each registered sheep individual in the individual archive database, based on its historical face image at at least two different time points, a biological evolution rule model is established for it; the biological evolution rule model is used to describe the rule of the face structure state vector of the sheep individual evolving with time sequence; S2, obtaining the face image to be authenticated of the sheep individual to be authenticated at the current time point, and extracting the face structure state vector to be authenticated therefrom; S3, traversing the individual archive database, and using the biological evolution rule model of each registered sheep individual to predict the theoretical face structure state vector of each registered sheep individual at the current time point; S4, calculating the residual vector between the face structure state vector to be authenticated and each theoretical face structure state vector, respectively; S5, determining the identity of the sheep individual to be authenticated according to the residual vector.
[0008] In one specific embodiment, the individual archive database is used to store the identity of each registered sheep individual, and the historical face image obtained at different collection time points associated with the identity.
[0009] Preferably, the face structure state vector and the face structure state vector to be authenticated are obtained by locating a plurality of preset biological key points in the face image through an image processing algorithm, and extracting the coordinates of the biological key points to form a vector by concatenating the coordinates.
[0010] Preferably, the biological evolution rule model is a Kalman filter model. The model is defined by the following state space equation: Process model: X j,k =F j ·X j,k-1 +w j,k-1 ; Measurement model: Z j,k =H·X j,k +v j,k ; In the formula: X j,k is the true face structure state vector of the registered sheep individual j at time point k; Z j,k is the observation vector of X j,k ; F j is the state transition matrix specific to the registered sheep individual j; w j,k-1 is a process noise vector, following a Gaussian distribution with mean 0 and covariance matrix Q j is the process noise covariance matrix; j H is an observation matrix, establishing the relationship between the state space and the observation space; j,k is a measurement noise vector, following a Gaussian distribution with mean 0 and covariance matrix R; • is a matrix multiplication operator.
[0011] In one embodiment, the process of establishing the biological evolution rule model in step S1 further comprises: using a system identification algorithm (such as the expectation maximization algorithm) to estimate the state transition matrix F and the process noise covariance matrix Q of the sheep individual through the sequence of the face structure state vectors of the history of the sheep individual.
[0012] Preferably, the specific implementation of determining the identity according to the residual error vectors in step S5 is as follows: First, for each registered sheep individual j, calculate its residual error vector y j : wherein: Z new is the face structure state vector to be authenticated; is the theoretical face structure state vector predicted according to the Kalman filter model of the registered sheep individual j.
[0013] Then, calculate the Mahalanobis distance of each residual error vector y j wherein: is the square of the Mahalanobis distance for the registered sheep individual j; is the transpose of the residual error vector y j ; C y,j is the covariance matrix of the residual error vector y j ; is the inverse matrix of the covariance matrix C y,j .
[0014] Finally, the registered sheep individual with the smallest Mahalanobis distance is determined as the identity of the sheep individual to be authenticated.
[0015] In one specific embodiment, the method further comprises the following step: after determining the identity of the sheep individual to be authenticated, outputting or storing the residual vector corresponding to the identity as a physiological state deviation vector representing the current physiological health state of the sheep individual.
[0016] Preferably, the method further comprises the following steps: collecting the physiological state deviation vectors generated by a plurality of sheep individuals in the flock at different time points; performing cluster analysis on the collected set of physiological state deviation vectors to identify clusters formed by individuals with similar deviation patterns; triggering an early warning when the number of sheep individuals in a certain cluster exceeds a preset threshold; wherein the preset threshold is determined according to the size of the flock or historical health data.
[0017] In one specific embodiment, the method further comprises the following steps: extracting the state transition matrix F or / and the process noise covariance matrix Q in the Kalman filter model as dynamic phenotypic features representing the growth stability and environmental adaptability of the sheep individual.
[0018] Preferably, the method further comprises the following steps: based on the dynamic phenotypic features, evaluating or screening candidate sheep individuals to obtain a breeding grade classification result for guiding breeding decisions.
[0019] In summary, the present application includes at least one of the following beneficial technical effects: 1. The present application establishes a dedicated biological evolution rule model for each sheep individual, and uses the model to predict the theoretical facial structure state vector at the current time point, and then compares it with the facial structure state vector to be authenticated. This authentication method based on dynamic model prediction and matching can actively adapt to the continuous changes in facial structure of individuals due to growth or aging throughout their life cycle, overcoming the recognition failure problem faced by traditional static feature comparison methods over a long time span, and improving the accuracy and reliability of identity authentication throughout the life cycle.
[0020] 2. After completing the identity authentication, the present application defines the calculated residual vector as a physiological state deviation vector, which quantifies the difference between the actual current facial structure of the sheep individual and the theoretical state predicted by the biological evolution rule model. Not only does it provide objective data indicators for evaluating the physiological health status of a single individual, but also through clustering analysis of the physiological state deviation vectors of multiple individuals in the flock, it can identify abnormal health patterns in the group, thereby realizing the extension of functions from individual diagnosis to group health warning.
[0021] 3. The present application extracts the state transition matrix and process noise covariance matrix in the biological evolution rule model (such as the Kalman filter model) and uses them as dynamic phenotype characteristics representing the growth stability and environmental adaptability of the individual. The model parameters describing the dynamic growth rule of the individual are converted into new digital quantitative traits that can be used for genetic evaluation, providing a new technical basis for sheep selection and breeding decisions in addition to traditional economic traits, which helps to cultivate populations with excellent internal biological characteristics. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 A flowchart of a sheep face identity authentication method for the whole life cycle tracing of agricultural and pastoral individuals according to an embodiment of the present application; Figure 2 A physiological state deviation analysis and group health warning flowchart according to an embodiment of the present application; Figure 3 A dynamic phenotype feature extraction and breeding assistance application flowchart according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be described in conjunction with the accompanying Figure 1 - the accompanying Figure 3 The present application will be further described in detail.
[0024] The present application provides a sheep face identity authentication method for the whole life cycle tracing of agricultural and pastoral individuals, which comprises the following steps: step S1, for each registered sheep individual in the individual archive database, based on its historical face images at at least two different time points, establish its exclusive biological evolution rule model.
[0025] Step S2, obtain the face image to be authenticated of the sheep individual to be authenticated at the current time point, and extract the face structure state vector to be authenticated therefrom.
[0026] Step S3, traverse the individual archive database, and use the biological evolution rule model of each registered sheep individual to predict the theoretical face structure state vector of each registered sheep individual at the current time point.
[0027] Step S4, respectively calculating the residual vector between the face structure state vector to be authenticated and each theoretical face structure state vector.
[0028] Step S5, determining the identity of the sheep individual to be authenticated according to the residual vector.
[0029] In one specific embodiment of the present application, the face structure state vector is formed by processing the sheep face image to obtain its geometric structure information.
[0030] First, N preset biological key points are located in the face image, each key point having two-dimensional coordinates. Subsequently, the coordinates of the N key points are concatenated to form a 2N x 1-dimensional column vector, which is the face structure state vector X k .
[0031] X k = [x k,1 , y k,1 , x k,2 , y k,2 ,..., x k,n , y k,n ,..., x k,N , y k,N ] T ; In the formula: x k,n is the horizontal coordinate of the nth key point at time point k, and n ranges from 1 to N; y k,n is the vertical coordinate of the nth key point at time point k, and n ranges from 1 to N; [·]T is a transposition operation on a vector or a matrix.
[0032] The biological evolution rule model is used to describe the face structure state vector X k over time. In this embodiment, the model is a Kalman filter model, which is jointly defined by a process model and a measurement model.
[0033] The process model describes the internal evolution rule of the face structure state from time point k-1 to time point k: X j,k = F j ·X j,k-1 + w j,k-1 ; In the formula: X j,k is the real face structure state vector of the registered sheep individual j at time point k; F j is a state transition matrix specific to the registered sheep individual j; w j,k-1 is the process noise vector, which follows a Gaussian distribution with mean 0 and covariance matrix Q j Q j is the process noise covariance matrix. • is the matrix multiplication operator.
[0034] The measurement model describes the relationship between the actual observation and the true state at time k: Z j,k = H · X j,k + v j,k ; wherein: Z j,k is the observation vector of X j,k ; H is the observation matrix, which establishes the relationship between the state space and the observation space; v j,k is the measurement noise vector, which follows a Gaussian distribution with mean 0 and covariance matrix R.
[0035] In an optional embodiment, considering that sheep individuals may exhibit more complex nonlinear growth patterns during certain rapid growth periods or special physiological periods, the biological evolution law model can also adopt a filtering model capable of handling nonlinear dynamics.
[0036] For example, an extended Kalman filter (EKF) can be used, which realizes local linearization by performing a first-order Taylor expansion on the nonlinear process model and measurement model.
[0037] Alternatively, an unscented Kalman filter (UKF) can be used, which can achieve higher prediction accuracy than EKF by using Unscented Transform to approximate the probability density of the state distribution. In the case of non-Gaussian noise or strong nonlinearity, a particle filter (Particle Filter) can also be used, which represents and updates the posterior probability distribution of the state by using the sequential Monte Carlo method.
[0038] When performing identity authentication, first, the theoretical face structure state vector of each registered sheep individual j in the database at the current time point new is obtained by prediction through step S3 Subsequently, the residual vector y new between the face structure state vector to be authenticated Z j and each theoretical value is calculated through step S4.
[0039] wherein: y j is the residual vector for the registered sheep individual j; Z new is the face structure state vector to be authenticated; is the theoretical face structure state vector predicted according to the model of the registered sheep individual j.
[0040] Finally, in step S5, the identity is determined by calculating the Mahalanobis distance of each residual vector. The calculation method of the Mahalanobis distance is: wherein: is the square of the Mahalanobis distance for the registered sheep individual j; is the transpose of the residual vector y j ; and C y,j is the covariance matrix of the residual vector y j ; and is the inverse matrix of the covariance matrix C y,j .
[0041] The registered sheep individual j with the smallest Mahalanobis distance is determined as the identity of the sheep individual to be authenticated.
[0042] In specific embodiments of the present application, the construction process of the face structure state vector involved in method steps S1 and S2 is described in detail. This process aims to convert the original sheep face image data into a standardized numerical vector that can accurately describe its geometric topological structure, serving as the input for subsequent biological evolution model processing.
[0043] First, image data acquisition and preprocessing are performed.
[0044] In a specific application scenario, fixed-position image acquisition devices, such as industrial cameras, can be deployed at passages (such as water points, feeding troughs, or dedicated passages) through which sheep individuals pass. To reduce the impact of light changes on image quality, a light supplement device can be equipped to provide uniform and stable lighting conditions. When a sheep individual enters the shooting area, the camera can be triggered to take pictures through radio frequency identification (RFID) ear tags, infrared sensors, or motion detection, etc. to obtain original images containing the face of the sheep individual.
[0045] After obtaining the original image, a series of preprocessing operations are performed to standardize the image. The preprocessing process includes: face detection: a pre-trained deep learning-based object detection model (such as the YOLO series or Faster R-CNN model optimized for sheep face data) is used to automatically locate the area where the sheep face is located in the original image and output the bounding box coordinates of the area.
[0046] Image cropping: According to the boundary box coordinates obtained by face detection, the original image is cropped to separate the main part containing only the sheep face, excluding the interference of the background and other irrelevant objects.
[0047] Pose alignment: In order to eliminate the pose changes caused by different shooting angles, the cropped sheep face image needs to be normalized. Through geometric transformation methods such as affine transformation or perspective transformation, the sheep face image is rotated, scaled and corrected to a preset standard pose, for example, the center line of the eyes is kept horizontal.
[0048] After completing the image preprocessing, the biological key points are located.
[0049] In this embodiment, the preset biological key points are points on the sheep face that are stable in anatomical structure and are not easily affected by expression or short-term soft tissue changes. For example, N key points can be selected, including but not limited to: left inner corner of eye, left outer corner of eye, right inner corner of eye, right outer corner of eye, nose tip, left corner of mouth, right corner of mouth, left ear root point, right ear root point, etc.
[0050] The principle of selecting key points is that they should have clear anatomical significance, have homology between different individuals, and their spatial distribution should fully cover the key areas of the face to capture both the growth changes of the overall contour and the relative position changes of local organs.
[0051] A specially trained key point detection model (for example, high-resolution network HRNet or stacked hourglass network) is used to process the pose-aligned sheep face image, and the pixel coordinates (u n ,v n ) of each preset biological key point are accurately output.
[0052] In order to make the final formed face structure state vector have scale invariance and translation invariance, the obtained pixel coordinates need to be normalized. A specific normalization method is to take the boundary box obtained by sheep face detection as the reference coordinate system, and convert the absolute pixel coordinates (u n ,v n ) of each key point to relative coordinates (x n ,y n ).
[0053] In the formula: u n , v n are the original horizontal and vertical coordinates u box , v boxx, y are the normalized relative horizontal and vertical coordinates. w box , h are the width and height of the face bounding box. box x, y are the normalized relative horizontal and vertical coordinates. x n , y n are the normalized relative horizontal and vertical coordinates.
[0054] In another optional embodiment, the normalization process can also be based on internal, more stable biological features. For example, the line connecting the two most stable landmarks (e.g. the inner corners of the eyes) can be selected as the reference baseline, and the center point coordinate and the length of this line can be calculated. Subsequently, the coordinates of all landmarks are transformed to a new coordinate system with the center point as the origin and the direction of the line as the x-axis, and all coordinate values are scaled by the length of the line. This normalization method based on internal anatomical features can better eliminate the affine transformation effects caused by slight head tilting or lateral deviation.
[0055] Finally, the normalized coordinates of all N landmarks are concatenated in a predetermined order to form a 2N x 1 dimensional column vector, which is the face structure state vector X k of the individual at the current time point.
[0056] X k = [x k,1 , y k,1 , x k,2 , y k,2 ,..., x k,n , y k,n ,..., x k,N , y k,N ] T ; In the formula: x k,n is the normalized horizontal coordinate of the nth landmark at time point k, n ranges from 1 to N; y k,n is the normalized vertical coordinate of the nth landmark at time point k, n ranges from 1 to N; [·]T is the transpose operation on vectors or matrices.
[0057] Through the above steps, both historical face images and face images to be authenticated can be converted into face structure state vectors with uniform structure and standard scale, providing high-quality, standardized data input for subsequent model establishment and identity authentication.
[0058] In a specific embodiment of the present invention, the process of establishing a unique biological evolutionary model for each registered sheep individual in method step S1 is described in detail. The core of this process lies in using the historical facial structure state vector sequence {Z} stored in the individual profile database for each registered sheep individual j. j,1 Z j,2 ,...,Z j,K We use this to estimate the parameters of a dynamic model that can accurately describe the individualized growth patterns of a single entity. Here, K is the total length of the historical observation sequence used for model estimation.
[0059] In this embodiment, the biological evolution model is a linear state-space model, specifically a Kalman filter model. This model consists of a process model and a measurement model. For a registered sheep individual j, the model can be represented as: Process Model: X j,k =F j ·X j,k-1 +w j,k-1 ; Measurement model: Z j,k =H·X j,k +v j,k ; In the formula: X j,k Let be the true facial structure state vector of the registered sheep individual j at time point k; Z j,k For X j,k The observation vector; F j This is a state transition matrix specific to the registered sheep individual j, which encodes the inherent deterministic laws governing the evolution of the facial structure of the registered sheep individual j over time. w j,k-1 Let Q be the process noise vector, which has a mean of 0 and a covariance matrix of Q. j Gaussian distribution, Q j That is, the process noise covariance matrix, which characterizes random perturbations or unmodeled dynamic changes during the individual growth process; H is the observation matrix, which establishes the relationship between the state space and the observation space. In this embodiment, since each component of the state vector (i.e., the coordinates of the key points) is directly observable, H can be set as the identity matrix I. v j,k The noise vector is measured and follows a Gaussian distribution with a mean of 0 and a covariance matrix of R. The covariance matrix R represents the measurement error introduced by the image acquisition and key point detection algorithms. This matrix can be pre-calibrated by performing multiple measurements on a stationary target and analyzing its statistical characteristics. It can be considered consistent for all individuals in the system. • This is the matrix multiplication operator.
[0060] Thus, for each registered sheep individual j, a model of its own biological evolution is established, i.e., a system identification problem is transformed: estimate its unique model parameter set Θ j,1 ,Z j,2 ,...,Z j,K} from its historical observation sequence {Z j = {F j , Q j}.
[0061] The expectation maximization (EM) algorithm is employed in this embodiment to accomplish the parameter estimation. The EM algorithm is an iterative procedure that alternates between the E-step (expectation step) and the M-step (maximization step) until the model parameters converge.
[0062] The algorithm starts with an initialization of the parameters. For example, the state transition matrix F j may be initialized as the identity matrix I, and the process noise covariance matrix Q j may be initialized as a diagonal matrix with small positive values on the diagonal.
[0063] In the m-th iteration, the following steps are performed: E-step (expectation step): based on the parameters obtained in the previous iteration and the entire historical observation data {Z j,1 , Z j,2 ,..., Z j,K}, run the Kalman smoother (e.g., Rauch-Tung-Striebel smoother). The purpose of this step is to compute the conditional expectation and conditional covariance of the hidden state variable (i.e., the true facial structure state vector) given the entire observation data. These computed statistics will be used for the parameter update in the M-step.
[0064] M-step (maximization step): using the statistics computed in the E-step, update the model parameters F j and Q j such that the log-likelihood function of the observation data is maximized given the current estimate of the hidden state variable.
[0065] The update formulas for the parameters are as follows: Update the state transition matrix F where: K is the total length of the historical observation sequence used for model estimation; denotes the summation operation over the sequence from time point k = 2 to K; E[·|Z j,1:Krepresents all the historical observation data Z of a given registered sheep individual j from time point 1 to K j,1:K the expectation under the condition; represents the outer product of state vectors; T is a transpose operation on a vector or a matrix; (·) -1 represents the inverse operation of a matrix.
[0066] updating the process noise covariance matrix The above E-step and M-step are repeatedly iterated until the changes of the parameters F j and Q j are less than a preset convergence warning threshold, or the increment of the log-likelihood function is less than the threshold.
[0067] After the iterative convergence, the final parameters F j and Q j are obtained, which constitute the exclusive biological evolution rule model of the registered sheep individual j.
[0068] The model is stored together with its initial state X j,0 and initial state covariance P j,0 in the individual archive database, associated with the identity of the individual, for subsequent identity authentication, health assessment and genetic analysis.
[0069] In specific embodiments of the present application, the identity authentication process constituted by the method steps S2 to S5 is described in detail. After receiving the facial image of the sheep individual to be authenticated, the process finally determines its identity by serializing matching with the biological evolution rule models of all registered individuals in the individual archive database.
[0070] First, step S2 is performed to obtain the facial image to be authenticated of the sheep individual to be authenticated at the current time point new, and process it into a standardized facial structure state vector Z new according to the construction method of the facial structure state vector described in the foregoing method steps S1 and S2.
[0071] Subsequently, a loop process traversing the individual archive database is entered. For each registered sheep individual j in the database, step S3 is performed, i.e., the theoretical state prediction is performed using its exclusive biological evolution rule model. The prediction is the prediction step in the Kalman filtering framework, which specifically includes: state prediction: based on the state optimal estimate value X updated by the last successful authentication of the registered sheep individual j at the time point last and its exclusive state transition matrix F j, the theoretical face structure state vector of the registered sheep individual j at the current time point new is predicted
[0072] wherein is the prior state estimate of the registered sheep individual j at the current time point new; F j is the state transition matrix specific to the registered sheep individual j; is the posterior state estimate of the registered sheep individual j at the last time point last.
[0073] Error covariance prediction: simultaneously, the uncertainty of the theoretical state vector, i.e. the error covariance matrix P j,new|last .
[0074] wherein P j,new|last is the prior error covariance matrix corresponding to the prior state estimate P j,last|last is the posterior error covariance matrix corresponding to the posterior state estimate Q j is the process noise covariance matrix specific to the registered sheep individual j; is the transposed matrix of the matrix F j .
[0075] After the prediction of the registered sheep individual j is completed, step S4 is performed, in which the residual vector y new and its covariance C j between the theoretical predicted value and the face structure state vector Z y,j to be authenticated are calculated.
[0076] C y,j = H · P j,new|last · H T + R; wherein y j is the residual vector for the registered sheep individual j; Z new is the face structure state vector to be authenticated; is the theoretical face structure state vector predicted according to the Kalman filter model of the registered sheep individual j; C y,j is the covariance matrix of the residual vector y j . H is an observation matrix; R is a measurement noise covariance matrix; • is a matrix multiplication operator.
[0077] Next, in step S5, the identity is determined based on the residual vector. This embodiment employs Mahalanobis distance as the metric of matching degree. The Mahalanobis distance square of the residual vector y j is calculated as wherein: is the Mahalanobis distance square for the registered sheep individual j, which provides a statistical measure of the deviation between the to-be-authenticated observation value Z new and the theoretical prediction of the registered sheep individual j, which has been normalized by the covariance C y,j ; is the transpose of the residual vector y j ; C y,j is the covariance matrix of the residual vector y j ; is the inverse matrix of the covariance matrix C y,j .
[0078] After traversing all the registered individuals in the individual profile database, a set of Mahalanobis distances corresponding to all the individuals is obtained wherein M is the total number of registered individuals in the database. The minimum value in the set is sought and the individual index j * corresponding thereto is the best matching candidate.
[0079] wherein argmin(·) is an operation of finding the minimum value of the expression in the parentheses; and is the Mahalanobis distance square for the registered sheep individual j.
[0080] Finally, the minimum Mahalanobis distance is compared with a pre-set identity authentication threshold τ to make a final decision.
[0081] If , the identity of the to-be-authenticated sheep individual is successfully confirmed as the individual j * .
[0082] If If the Mahalanobis distance between the individual to be authenticated and any individual in the database is larger than the threshold τ, the individual is considered as unregistered or the authentication fails.
[0083] The method of determining the threshold τ is as follows: A validation dataset is constructed, which contains two parts: one part is the face images of the sheep individuals with known identities at different time points (positive samples), and the other part is the face images of sheep individuals not registered in the individual archive database (negative samples).
[0084] The dataset is processed through the authentication process of the present application to obtain the distribution of Mahalanobis distances when all positive samples match their correct identities, and the distribution of Mahalanobis distances when all negative samples match their nearest neighbors.
[0085] Based on the two distributions, the Receiver Operating Characteristic (ROC) curve can be drawn, and according to the preset false acceptance rate (FAR) and false rejection rate (FRR) requirements, an optimal balance point can be selected as the threshold τ. For example, the Mahalanobis distance value that makes the FRR minimum when the FAR is less than 0.1% can be selected as τ.
[0086] In a preferred embodiment, after the identity of the individual to be authenticated is successfully confirmed as individual j * , the system performs the update step of Kalman filtering to correct and update the state estimation of individual j new using the effective observation Z * this time, so that the biological evolution model of the individual can continue to adapt. The update process includes calculating the Kalman gain and updating the posterior state estimation and the posterior error covariance P j,new|new .
[0087] These updated values will be used as input for the next prediction of the individual, i.e. as the new “_last|last” values, so as to realize the closed-loop iteration and optimization of the model.
[0088] In a specific embodiment of the present application, the application of the identity authentication process is expanded and described in detail, which aims to use the intermediate data generated during the authentication process to realize the health status monitoring of sheep individuals and the health risk warning of the herd.
[0089] In the identity authentication process, after the identity of the sheep individual to be authenticated is successfully confirmed as individual j * , the system generates its corresponding residual vector
[0090] This vector quantifies the actual face structure observation value Z newdeviation from the theoretical state predicted by its own biological evolution model.
[0091] In this embodiment, the residual vector is endowed with a new technical meaning, defined as the physiological state deviation vector. A healthy and normally growing individual should have a physiological state highly consistent with its own historical evolution law, so the norm (i.e. size) of its physiological state deviation vector should be maintained at a low level. When the individual's physiological state changes unexpectedly due to factors such as disease, stress or malnutrition, this change will be reflected as an abnormal shift in the position of the facial key points, resulting in a significant increase in the norm of its physiological state deviation vector, or its vector direction pointing to a specific pattern.
[0092] The system records the physiological state deviation vector generated for each successfully authenticated individual, along with the current timestamp and the individual's identity, in the health state database. By analyzing the sequence of physiological state deviation vectors of a single individual at consecutive time points, the dynamic trend of its health status can be tracked.
[0093] On this basis, the method of the present application further realizes population health warning. This process collects the physiological state deviation vectors generated by all successfully authenticated individuals in the flock within a certain preset time window (e.g. the past 24 hours) to form a high-dimensional data point set {y1, y2,..., yP}, where P is the total number of individuals effectively observed within the time window. P}, where P is the total number of individuals effectively observed within the time window.
[0094] Subsequently, the system performs clustering analysis on the data point set to identify population abnormal health patterns. The present embodiment uses the density-based spatial clustering of applications with noise (DBSCAN) algorithm.
[0095] This algorithm does not require prior specification of the number of clusters, and can effectively identify clusters of arbitrary shape and noise points. The execution of the DBSCAN algorithm requires two key parameters: the neighborhood radius ∈ and the minimum number of neighborhood points MinPts required for a core object.
[0096] In a specific embodiment, the neighborhood radius ∈ can be determined with the help of the k-distance graph method.
[0097] Calculate the distance from each point in the data set to its k # th nearest neighbor (k # th nearest neighbor is usually around MinPts), sort and visualize these distances, and select the corresponding value at the "inflection point" of the curve as ∈.
[0098] The value of parameter MinPts is determined according to the application scenario, for example, it can be set to a minimum sick population size with clinical significance, such as 3 or 4.
[0099] Further, after triggering the early warning, the system can also perform in-depth analysis on each abnormal cluster C m . Specifically, the centroid vector of all physiological state deviation vectors in the cluster can be calculated, that is,
[0100] In the formula: is the centroid vector, which represents the "average deviation pattern" commonly shown by the abnormal population; C m is the identified abnormal cluster.
[0101] By analyzing the components with larger or smaller values in the vector, the specific facial key points that have undergone abnormal changes can be located, thereby providing the veterinarian or technician with preliminary diagnostic clues about the health problems of the population (for example, is it an eye disease, a foot and mouth problem, or facial emaciation caused by malnutrition).
[0102] The system traverses each physiological state deviation vector in the set.
[0103] For a vector y j , if the number of vectors contained in its ∈-neighborhood is not less than MinPts, the vector is marked as a core object.
[0104] Starting from any core object, recursively find all density-reachable vectors (i.e., in the ∈-neighborhood of each other) and divide them into the same cluster.
[0105] Vectors that do not belong to any cluster are marked as noise points, representing isolated, non-population deviations.
[0106] Through clustering analysis, the original data point set is divided into one or more clusters C1, C2... Each cluster represents a specific abnormal health pattern that commonly occurs in multiple individuals, and all vectors in the cluster show similar direction and amplitude in the 2N-dimensional space.
[0107] Finally, the system analyzes each identified cluster C m , and counts the number of individuals it contains |C m |. The number is compared with a preset early warning threshold η.
[0108] The early warning threshold η is not a fixed value, but is dynamically determined according to the specific technical conditions of the farm. For example, it can be set as a fixed percentage of the total size of the flock (such as 0.5%), or based on historical health data, for example, according to the minimum size of the sick population that can be detected at the initial stage when the epidemic occurred in the past.
[0109] If there is any cluster whose number of individuals |C m exceeds the early warning threshold η, i.e., |C m > η, the system automatically triggers an early warning. The early warning actions can include: sending a structured data packet containing information such as early warning level, list of affected individual IDs, cluster center vector (representing the typical abnormal pattern of the group) to the management system server; pushing alarm notifications to the mobile terminals of the field management personnel through the application; or highlighting the relevant areas and individuals on the electronic map of the central monitoring interface.
[0110] In specific embodiments of the present application, the process of breeding assistance using established biological evolution law models is described in detail. This process aims to extract dynamic phenotypic characteristics that can quantify the growth and development characteristics of each individual from the individual's exclusive model parameters, and apply these characteristics to the evaluation and selection of breeding sheep.
[0111] For each registered sheep individual j in the individual archive database, its exclusive biological evolution law model is uniquely determined by the parameter set Θ j = {F j , Q j}. The present application uses these model parameters themselves as a new type of quantifiable trait representation. Specifically, two dynamic phenotypic characteristics are defined: Growth stability characteristic: This characteristic is derived from the process noise covariance matrix Q j .
[0112] The size of the matrix Q j reflects the degree of random disturbance of the individual's growth process from its inherent deterministic law. An individual that is more genetically stable and less sensitive to subtle changes in the environment will have a smaller value of Q j . Therefore, a scalar characteristic S j can be defined to quantify this stability: S j = trace(Q j ); where: trace(·) is the trace operation of the matrix, i.e., the sum of the main diagonal elements of the matrix.
[0113] S jThe smaller the value, the more stable the growth process of the individual and the higher its genetic stability.
[0114] Growth rate characteristic: This characteristic is determined by the state transition matrix F j Export.
[0115] Matrix F j This describes the deterministic trend of facial structure changes from one time point to the next, and its magnitude reflects, to some extent, the overall growth rate of an individual. Therefore, a scalar feature G can be defined. j To quantify growth rate: G j =||F j || F ; In the formula: ||·|| F Let be the Frobenius norm of the matrix.
[0116] G j The larger the value, the greater the overall growth change in the individual's facial structure and the faster the growth rate.
[0117] For each candidate breeding sheep, the system automatically calculates its corresponding growth stability characteristic S. j and growth rate characteristics G j These two features constitute a two-dimensional dynamic phenotypic feature vector [S]. j G j This vector quantifies an individual's genetic potential from the perspective of facial morphological evolution.
[0118] By comparing the dynamic phenotypic characteristics of individuals with preset breeding standards, or by ranking the dynamic phenotypic characteristics of multiple candidate individuals, quantitative data support can be provided for breeding decisions.
[0119] In summary, the sheep face identification method for tracing the entire life cycle of agricultural and pastoral individuals provided by this invention is based on establishing a unique biological evolution law model for each individual sheep, using a state-space model. This method does not rely on static feature comparison; instead, it predicts the theoretical facial structure state of the individual at the current time point through this dynamic model, calculates the residual vector between the theoretical state and the actual observed state, and finally determines the identity based on the statistical measure of this residual vector. This achieves adaptive authentication based on the continuous changes in facial structure throughout the individual's life cycle.
[0120] Further, the embodiments of the present application reuse technical elements in the identity authentication process. On the one hand, the residual vector obtained after identity confirmation is defined as a physiological state deviation vector, which is used to quantitatively evaluate the individual's immediate health status, and the early warning of group health risks is realized through clustering analysis of group deviation vectors. On the other hand, the state transition matrix and process noise covariance matrix extracted from the individual's exclusive biological evolution law model are defined as dynamic phenotype characteristics representing the individual's growth stability and environmental adaptability, providing new quantitative data dimensions for breeding evaluation and screening.
[0121] Through the combination of the above technical solutions, the present application constitutes a set of data-driven fine management system for agricultural and pastoral individuals, which integrates identity authentication, health monitoring and breeding assistance functions.
[0122] The core challenge of traditional face recognition technology is to realize the invariance of interference factors such as expression, posture and illumination. Its technical route is to perform static feature matching based on deep learning network (CNN), aiming to confirm the identity of a relatively stable adult face.
[0123] Unlike traditional face recognition technology, the present application aims to solve the problem of tracing individuals from childhood to adulthood in the agricultural and pastoral industry. The core challenge is to accurately model and utilize the long-term variability of facial morphology. Therefore, the present application creatively adopts the dynamic law conformity test technical route. Instead of using CNN for static comparison, we establish an exclusive biological evolution law model for each individual, taking the individual's growth law itself as a dynamic carrier of its identity. The recognition process is not feature matching, but by testing whether the current appearance of the individual to be authenticated conforms to the theoretical growth state predicted by its exclusive model.
Claims
1. A sheep face identity authentication method for the whole life cycle traceability of agricultural and pastoral individuals, characterized by, The method comprises the following steps: S1, for each registered sheep individual in an individual archive database, based on historical face images at at least two different time points, a unique biological evolution model is established; the biological evolution model is used to describe the rule of the face structure state vector of the sheep individual evolving with time; S2, obtaining a face image to be authenticated of a sheep individual to be authenticated at a current time point, and extracting a face structure state vector to be authenticated therefrom; S3, traversing the individual archive database, and using the biological evolution model of each registered sheep individual to predict a theoretical face structure state vector of each registered sheep individual at the current time point; S4, respectively calculating residual error vectors between the face structure state vector to be authenticated and each theoretical face structure state vector; S5, determining the identity of the sheep individual to be authenticated according to the residual error vectors.
2. The sheep face identity authentication method for individual whole life cycle traceability of agriculture and animal husbandry according to claim 1, characterized in that, The individual archive database is used to store the identity of each registered sheep individual, and the historical face images obtained at different collection time points associated with the identity. 3.The sheep face identity authentication method for tracing the whole life cycle of an individual sheep or goat according to claim 1, characterized in that, The face structure state vector and the face structure state vector to be authenticated are vectors formed by locating a plurality of preset biological key points in the face image and obtaining the coordinates of the biological key points.
4. The sheep face identity authentication method for individual whole life cycle tracing of agriculture and animal husbandry according to claim 1, characterized in that, The biological evolution model is a Kalman filter model, and the Kalman filter model comprises a state transition matrix and a process noise covariance matrix for describing the growth rule of the registered sheep individual.
5. The sheep face identity authentication method for individual whole life cycle traceability of agriculture and animal husbandry according to claim 4, characterized in that, Step S1 further comprises: The state transition matrix and the process noise covariance matrix unique to the registered sheep individual are estimated through a sequence of historical face structure state vectors of the registered sheep individual.
6. The sheep face identity authentication method for individual whole life cycle traceability of agriculture and animal husbandry according to claim 4, characterized in that, Step S5 specifically comprises: The Mahalanobis distance of each residual error vector is calculated, and the registered sheep individual with the smallest Mahalanobis distance is determined as the identity of the sheep individual to be authenticated.
7. The sheep face identity authentication method for individual whole life cycle traceability of agriculture and animal husbandry according to claim 4, characterized in that, Further comprising the following steps: After determining the identity of the sheep individual to be authenticated, the residual error vector corresponding to the identity is output or stored as a physiological state deviation vector representing the current physiological health state of the sheep individual.
8. The sheep face identity authentication method for individual whole life cycle traceability of agriculture and animal husbandry according to claim 7, characterized in that, The physiological state deviation vectors generated by a plurality of sheep individuals in a sheep flock at different time points are collected; The collected physiological state deviation vectors are subjected to cluster analysis to identify a group abnormal health pattern, and when the number of sheep individuals showing the same abnormal health pattern exceeds a preset threshold, a warning is triggered; The preset threshold is determined according to the size of the sheep flock or historical health data.
9. The sheep face identity authentication method for individual whole life cycle tracing of agriculture and animal husbandry according to claim 4, characterized in that, Further comprising the following steps: The state transition matrix or / and the process noise covariance matrix in the Kalman filter model are extracted as dynamic phenotype features representing the growth stability and environmental adaptability of the sheep individual.
10. The sheep face identity authentication method for individual whole life cycle tracing of agriculture and animal husbandry according to claim 9, characterized in that, Based on the dynamic phenotype features, a candidate sheep individual is evaluated or screened to obtain a breeding grade classification result for guiding breeding decisions.