Image Recognition-Based Livestock and Poultry Vital Sign Detection Method and System

By combining binocular depth cameras and infrared thermal imaging, a three-dimensional mask is generated and a spatiotemporal behavioral topology map is constructed. Graph convolutional neural networks are then used to analyze livestock and poultry physical characteristics, solving the problem of individual identification in complex backgrounds and low illumination during livestock and poultry physical characteristic detection, and achieving efficient detection of livestock and poultry physical characteristics.

CN122090486AInactive Publication Date: 2026-05-26GUIZHOU HONGYU ANIMAL HUSBANDRY TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUIZHOU HONGYU ANIMAL HUSBANDRY TECH DEV CO LTD
Filing Date
2026-04-23
Publication Date
2026-05-26
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing technologies, livestock and poultry vital sign detection methods based on image recognition cannot accurately segment individuals when livestock and poultry occlude or overlap with each other. Complex backgrounds in the breeding environment cause background difference algorithms to fail, and effective vital sign features cannot be extracted under low light conditions, making it difficult to capture subtle dynamic vital signs with changes in depth information.

Method used

By combining binocular depth cameras and infrared thermal imaging, a 3D mask is generated through instance segmentation using temperature gradient boundaries. A skeleton model is constructed and a spatiotemporal behavioral topology map is built. A graph convolutional neural network is used to analyze the motion energy matrix of livestock and poultry, and the eigenvalue dispersion is calculated to quantify abnormal physical signs.

Benefits of technology

It improves the sensitivity and robustness of detecting subtle gait abnormalities and latent lesions, solves the problem of individual identification failure under complex background and low illumination conditions, and achieves efficient detection of livestock and poultry physical signs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122090486A_ABST
    Figure CN122090486A_ABST
Patent Text Reader

Abstract

This invention relates to the field of machine vision technology, specifically to a method and system for detecting livestock and poultry vital signs based on image recognition. The method includes the following steps: acquiring a depth point cloud sequence of the target to be detected using a binocular depth sensing device positioned above the breeding area; removing background interference through thermal imaging calibration and generating a three-dimensional mask of the target; constructing a three-dimensional skeleton model encompassing joint displacement and rotation angles based on the mask mapping; converting the time series of the skeleton model into a spatiotemporal behavioral topology map; calculating the energy transfer loss of each node in the topology map and generating a vital sign abnormality index. In this invention, a dual-modal analysis mechanism fusing depth point cloud and thermal imaging data effectively avoids the interference of lighting changes and object occlusion on detection accuracy in complex breeding environments. Utilizing the energy loss analysis logic of the spatiotemporal topology map, it quantifies subtle gait differences and respiratory frequency fluctuations in livestock and poultry during dynamic movement, achieving non-contact, high-sensitivity capture of early lesion signs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, and in particular to a method and system for detecting the vital signs of livestock and poultry based on image recognition. Background Technology

[0002] Machine vision technology involves core technologies that utilize optical imaging equipment to simulate human visual functions and use computer algorithms to identify, measure, and analyze acquired images or video streams. It encompasses multiple technical stages, including image acquisition, preprocessing, feature extraction, and pattern recognition, and is widely applied in industrial inspection, medical diagnosis, and intelligent monitoring. Traditional image recognition-based methods for detecting livestock and poultry physical characteristics involve using ordinary RGB surveillance cameras to collect video data from farms, extracting the contours of moving targets using background subtraction or inter-frame subtraction methods, and then determining whether livestock and poultry have obvious injuries or abnormal postures based on the pixel statistical features of two-dimensional images (such as aspect ratio and duty cycle) or simple convolutional neural network classifiers.

[0003] Existing technologies that use a single RGB lens to acquire two-dimensional planar images cannot accurately segment individuals when livestock and poultry are occluded or overlapping. The complex texture of grass mats and fecal stains in the breeding environment can easily cause background subtraction algorithms to fail and generate a large number of false detections. Processing logic that relies on visible light data cannot obtain effective physical characteristics through contour extraction algorithms at night or under low light conditions. Analysis methods based solely on two-dimensional pixel statistics are difficult to capture subtle dynamic physical signs involving changes in depth information, such as limping or rapid breathing. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies and to propose a method and system for detecting the vital signs of livestock and poultry based on image recognition.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: a livestock and poultry vital sign detection method based on image recognition, comprising the following steps: S1: Control the binocular depth camera located above the monitoring area to acquire the depth point cloud sequence and infrared thermal distribution map of livestock and poultry. Perform instance segmentation based on the temperature gradient boundary of the infrared thermal distribution map to generate a three-dimensional mask. Use the three-dimensional mask to filter out the background from the depth point cloud sequence and extract the point cloud data. S2: Voxelize and downsample the point cloud data and calculate the normal vector distribution. Based on the curvature features of the normal vector distribution, locate anatomical feature points. Combine the anatomical feature points according to biological connection logic to construct a skeleton model. Extract the joint coordinate vectors of consecutive frames of the skeleton model. S3: Construct a spatiotemporal behavior topology graph with spatiotemporal edges based on the joint coordinate vectors, input the spatiotemporal behavior topology graph into a preset graph convolutional neural network to aggregate features to generate a motion energy matrix, and calculate the eigenvalue dispersion of the motion energy matrix; S4: Project the eigenvalue dispersion onto the healthy manifold space and calculate the geodesic distance. Quantize and generate a vital sign abnormality index based on the geodesic distance. If the vital sign abnormality index exceeds the dynamic safety threshold, trigger an alarm control command.

[0006] As a further aspect of the present invention, step S1 specifically comprises: S11: Acquire the initial depth point cloud sequence of the target livestock and poultry in the monitoring area and the corresponding infrared thermal distribution map, which are synchronously collected by the binocular depth camera. By traversing and analyzing the temperature gradient change rate of each pixel in the thermal distribution map matrix, the thermal radiation difference boundary between the background environment and the living target is identified. A multi-scale connected domain instance segmentation algorithm is executed along the calculated temperature gradient boundary contour to define the physiological contour of the target in the three-dimensional coordinate system and generate a three-dimensional mask. S12: Obtain the initial depth point cloud sequence and 3D mask. Use the camera intrinsic and extrinsic parameter matrix to perform affine transformation mapping and scale alignment between the 2D pixel space system of the 3D mask and the point cloud coordinate system in the 3D physical space. Traverse all 3D spatial points in the sequence one by one and calculate the spatial mapping position. Remove non-target background noise and environmental interference items that do not fall within the mask coverage area and extract the point cloud data.

[0007] As a further aspect of the present invention, step S2 specifically includes: S21: Acquire point cloud data, use an octree space partitioning strategy to divide the discrete point cloud space into multiple cubic voxel grids of the same size, calculate the three-dimensional spatial centroid coordinates of all points in each voxel grid to replace the original dense point cloud, and use principal component analysis to solve the eigenvector corresponding to the minimum eigenvalue of the local covariance matrix in the neighborhood of the downsampled point cloud, and calculate the normal vector distribution. S22: Obtain the normal vector distribution, traverse the local geometric surface of each data point after downsampling and calculate the Gaussian curvature and average curvature physical quantities, mark the region where the curvature physical quantity value exceeds the preset curvature judgment standard as candidate joint nodes, use the non-maximum suppression algorithm to filter and remove redundant neighboring candidate points in three-dimensional space, and locate anatomical feature points. S23: Obtain the anatomical feature points, and based on the prior kinematic topology and biological connection logic of the target species, use the spatial connectivity graph algorithm to establish rigid skeletal topological edges with length constraints for adjacent anatomical nodes, construct a skeleton model, and track and record the dynamic changes of the three-dimensional spatial coordinates of each key node in continuous time sampling frames to extract joint coordinate vectors.

[0008] As a further aspect of the present invention, step S3 specifically comprises: S31: Obtain the joint coordinate vector, define each body joint in a single frame as a spatial graph node and establish spatial topological edges based on the physical connection relationship of the skeleton, and at the same time establish temporal tracking connection edges with time evolution dependency between the same corresponding joints in adjacent time frames, and construct a spatiotemporal behavior topological graph under a three-dimensional data analysis system that includes both time and space dimensions. S32: Obtain the spatiotemporal behavior topology graph, feed it as a standard input tensor into a preset graph convolutional neural network model, extract the node motion trend and linkage cooperative change features in the temporal evolution dimension and spatial structure dimension respectively through multi-layer graph convolutional kernels, and perform global average pooling spatial compression and nonlinear function mapping calculation on the extracted hidden layer feature vectors to generate a motion energy matrix. S33: Obtain the motion energy matrix, perform singular value decomposition on the motion energy matrix to extract the set of eigenvalue vectors in each orthogonal principal component direction, calculate the data variance of all non-zero eigenvalue distribution vectors and the information entropy distribution probability after normalization, and calculate the eigenvalue dispersion by measuring the uncertainty level of the energy state and the degree of fluctuation of the target action intensity.

[0009] As a further aspect of the present invention, step S4 specifically comprises: S41: Obtain the discreteness of the feature roots, map the discrete metric values ​​as state representation vectors to the non-Euclidean Riemannian manifold space surface structure representing the steady state of health of the organism, locate the reference origin of the manifold space corresponding to the historical health state mean data, solve the shortest smooth surface geometric path between the current state representation vector and the health reference origin by calculating the Riemannian metric integral path on the tangent plane of the manifold space, and calculate the geodesic distance; S42: Obtain the geodesic distance, call the preset physiological risk quantification mapping calculation function to perform numerical amplification and smooth normalization mapping processing on the distance index, and convert the geodesic distance into a continuous value reflecting the functional decline of the organism or the intensity of pathological stress, and quantify and generate a vital sign abnormality index. S43: Obtain the abnormal vital signs index, compare the currently generated index value with the dynamic safety threshold generated dynamically based on the ambient temperature fluctuation and the target age cycle, and when it is determined that the index value continuously exceeds the maximum allowable safety limit standard for a specified time observation window, send a control signal to the monitoring terminal platform to trigger an alarm control command.

[0010] As a further aspect of the present invention, the process of extracting point cloud data specifically includes: The initial depth point cloud sequence and 3D mask are obtained. The focal length parameter, principal point offset and lens distortion correction coefficient contained in the camera intrinsic and extrinsic parameter matrix are extracted. The calibration parameters are used to perform affine transformation mapping and scale alignment between the 2D pixel space system of the 3D mask and the point cloud coordinate system in the 3D physical space. The algorithm iterates through all three-dimensional spatial points in the initial depth point cloud sequence and calculates their two-dimensional coordinate vectors after affine transformation. It constructs a ray intersection topology judgment logic for the three-dimensional mask boundary polygon to evaluate the geometric position of each spatial point. It compares the mask region boundary with the projected coordinates, removes background noise and environmental interference terms that do not fall within the effective mask coverage area and have abrupt changes in local depth gradient, and extracts point cloud data.

[0011] As a further aspect of the present invention, the process of generating the motion energy matrix specifically includes: The spatiotemporal behavior topology graph is obtained and fed into a preset graph convolutional neural network model as a standard input tensor. Multi-layer spatial graph convolutional kernels are activated to extract the link cooperative deformation features between adjacent joint nodes at the same time. Activate multi-layer temporal convolution kernels to extract the temporal evolution features of spatial displacement velocity and acceleration of the same joint node within a continuous sliding time window. Then, fuse and splice the spatial deformation features and temporal evolution features in the channel dimension to output the node feature matrix. Obtain the node feature matrix, perform feature dimension reduction using an adaptive weight allocation network, construct an adjacency matrix based on node physical connectivity, and calculate the overall spatiotemporal energy distribution state. The calculation formula is as follows: ; in, Represents the motion energy matrix, Represents an adjacency matrix constructed based on node connectivity. Representative node feature matrix, Represents the feature weight matrix. Represents a non-linear activation function. This represents the matrix multiplication operator, which performs the summation and mapping operations on all elements within the matrix according to the above formula, generating the motion energy matrix.

[0012] As a further aspect of the present invention, the process of calculating the eigenvalue dispersion specifically includes: Obtain the motion energy matrix, perform singular value decomposition on the motion energy matrix, extract the corresponding eigenvectors in each orthogonal principal component direction, and remove invalid eigenvectors that are close to zero due to computational noise; Extract all non-zero eigenvalues ​​and normalize them to construct a dimensionless eigenvalue statistical sample set. Calculate the mathematical mean of all eigenvalue values ​​in the eigenvalue statistical sample set. Calculate the squared absolute deviation between each eigenvalue and the mathematical mean. Statistically calculate the data variance and information entropy distribution probability of the normalized non-zero eigenvalues. By comprehensively assessing the uncertainty level of the energy state and the fluctuation degree of the target action intensity, and calculating the data index of system state disorder based on the extracted data variance and information entropy distribution probability, the calculation formula is as follows: ; in, Represents the dispersion of the eigenvalues. This represents the total number of non-zero eigenvalues ​​extracted. Represents the normalized first The specific values ​​of the non-zero eigenvalues This represents the mathematical mean of all normalized non-zero eigenvalues. This represents the dimensionless hyperparameter used to balance the variance and information entropy weights. The value of information entropy is represented by the probability of the distribution of non-zero eigenvalues. This formula is used to quantify and evaluate the degree of discrete shift in the energy distribution and to calculate the discreteness of the eigenvalues.

[0013] As a further aspect of the present invention, the process of quantifying and generating the abnormal vital signs index specifically includes: The geodesic distance and the preset physiological risk quantification mapping function are obtained. The baseline metabolic decay coefficient and stress sensitivity amplification factor contained in the physiological risk quantification mapping function are extracted. The current geodesic distance is linearly smoothed and corrected using the baseline metabolic decay coefficient. The stress sensitivity amplification factor is used to perform numerical amplification on the smoothed geodesic distance, and a normalization layer module is activated in series at the end of the calculation result to map and transform the numerical value into a standardized range of zero to one hundred, thereby quantifying and generating a vital sign abnormality index.

[0014] A livestock and poultry vital sign detection system based on image recognition, the system being used to implement the aforementioned livestock and poultry vital sign detection method based on image recognition, the system comprising: The data acquisition module controls a binocular depth camera located above the monitoring area to acquire depth point cloud sequences and infrared thermal distribution maps of livestock and poultry. Based on the temperature gradient boundary of the infrared thermal distribution map, it performs instance segmentation to generate a three-dimensional mask. The three-dimensional mask is then used to filter out the background from the depth point cloud sequence and extract the point cloud data. The model building module performs voxel downsampling on point cloud data and calculates the normal vector distribution. Based on the curvature features of the normal vector distribution, it locates anatomical feature points and combines the anatomical feature points according to biological connection logic to construct a skeleton model and extracts joint coordinate vectors. The feature calculation module constructs a spatiotemporal behavior topology graph based on the joint coordinate vector, inputs the spatiotemporal behavior topology graph into a preset graph convolutional neural network to aggregate features to generate a motion energy matrix, and calculates the eigenvalue dispersion of the motion energy matrix. The abnormal alarm module projects the eigenvalue dispersion onto the healthy manifold space and calculates the geodesic distance. Based on the geodesic distance, it quantifies and generates a vital sign abnormality index. If the vital sign abnormality index exceeds the dynamic safety threshold, it triggers an alarm control command.

[0015] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by integrating a dual-modal data acquisition mechanism of binocular depth camera and infrared thermal imaging, and using temperature gradient boundaries to assist in instance segmentation of depth point clouds, the problem of individual recognition failure caused by complex background textures and insufficient illumination is completely solved. By constructing a spatiotemporal behavioral topology graph containing spatiotemporal connection edges and combining it with a graph convolutional network, discrete skeletal motion is transformed into a continuous motion energy matrix, realizing the quantitative analysis of deep physical signs such as limb coordination. By calculating the geodesic distance of the feature value dispersion in the standard healthy manifold space, the detection sensitivity and robustness of subtle gait abnormalities and latent lesion signs are significantly improved. Attached Figure Description

[0016] Figure 1 This is a flowchart of the livestock and poultry vital sign detection method based on image recognition according to the present invention; Figure 2 This is a flowchart illustrating the point cloud data extraction and refinement process of this invention. Figure 3 This is a detailed flowchart of the feature localization and coordinate extraction process of the present invention; Figure 4 This is a detailed flowchart of the calculation of the spatiotemporal energy matrix and discreteness in this invention; Figure 5 This is a detailed flowchart of the abnormal vital sign judgment and alarm process of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the software-based technical solution is described in detail below with reference to system architecture diagrams and embodiments. It should be understood that the specific embodiments described herein are only for explaining the technical solutions of this invention and do not constitute a limitation on the scope of protection.

[0018] In the description of this invention, the system architecture relationships or data processing flows indicated by terms such as "layer," "module," "interface," "data flow," "client," and "server" are all defined based on the architecture diagram or flowchart corresponding to the embodiments. This way of describing is only used to clearly illustrate the logical relationships between the elements in the technical solution, and not to limit the physical deployment form. The term "multiple" includes two or more technical units, including but not limited to multiple data nodes, processing threads, service instances, or functional components and other scalable elements. The specific number is determined according to the actual business scenario and needs to be specifically specified.

[0019] Please see Figure 1 and Figure 2 This invention provides a technical solution: a method for detecting the vital signs of livestock and poultry based on image recognition, comprising the following steps: S1: Control the binocular depth camera located above the monitoring area to acquire the depth point cloud sequence and infrared thermal distribution map of livestock and poultry. Perform instance segmentation based on the temperature gradient boundary of the infrared thermal distribution map to generate a three-dimensional mask. Use the three-dimensional mask to filter out the background from the depth point cloud sequence and extract the point cloud data.

[0020] The specific steps of S1 are as follows: S11: Acquire the initial depth point cloud sequence and corresponding infrared thermal distribution map of the target livestock and poultry in the monitoring area, which are synchronously collected by the binocular depth camera. By traversing and analyzing the temperature gradient change rate of each pixel in the thermal distribution map matrix, the thermal radiation difference boundary between the background environment and the living target is identified. Then, a multi-scale connected domain instance segmentation algorithm is executed along the calculated temperature gradient boundary contour to define the physiological contour of the target in the three-dimensional coordinate system and generate a three-dimensional mask.

[0021] S12: Obtain the initial depth point cloud sequence and 3D mask. Use the camera intrinsic and extrinsic parameter matrix to perform affine transformation mapping and scale alignment between the 2D pixel space system of the 3D mask and the point cloud coordinate system in the 3D physical space. Traverse all 3D spatial points in the sequence one by one and calculate the spatial mapping position. Remove non-target background noise and environmental interference items that do not fall within the mask coverage area and extract the point cloud data.

[0022] The process of extracting point cloud data specifically includes: The initial depth point cloud sequence and 3D mask are obtained. The focal length parameter, principal point offset and lens distortion correction coefficient contained in the camera intrinsic and extrinsic parameter matrix are extracted. The 2D pixel space system of the 3D mask is affinely transformed and scaled to the point cloud coordinate system in the 3D physical space using calibration parameters.

[0023] The algorithm iterates through all three-dimensional spatial points in the initial depth point cloud sequence and calculates their two-dimensional coordinate vectors after affine transformation. It constructs a ray intersection topology judgment logic for the three-dimensional mask boundary polygon to evaluate the geometric position of each spatial point. It compares the mask region boundary with the projected coordinates, removes background noise and environmental interference terms that do not fall within the effective mask coverage area and have abrupt changes in local depth gradient, and extracts point cloud data.

[0024] Based on the monitoring scenario, a data transmission channel was established between a binocular depth camera located 3000mm above the monitoring area and the processing terminal. The binocular depth camera was controlled to project an infrared speckle map onto a 4000mm x 4000mm pig monitoring area directly below at a fixed sampling frequency of 30 frames per second, while simultaneously receiving reflected light signals. The underlying data stream of the camera hardware was analyzed in real time to calculate and obtain an initial depth point cloud sequence with a resolution of 1280 x 720. At the same time, the infrared thermal imaging sensor component rigidly connected to the binocular depth camera was retrieved to simultaneously acquire 16-bit infrared thermal distribution map matrix data with a resolution of 640 x 480. The initial depth point cloud sequence was input into a spatial median filter to perform noise reduction and smoothing. The filter kernel size was set to 5 x 5, and the mean depth of the neighborhood was used to interpolate and fill in the missing depth areas. Histogram equalization was performed on the synchronously acquired infrared thermal distribution map matrix data to stretch the temperature distribution contrast and linearly map its pixel values ​​to the actual physical temperature value matrix. Each element in the matrix represents the corresponding spatial location in degrees Celsius.

[0025] The infrared thermal distribution map matrix after temperature mapping is extracted. A 2D traversal pointer is initialized, and the temperature value of each pixel in the matrix is ​​read row by row and column by column using a sliding window with a step size of 1. A 3x3 Sobel edge detection operator matrix is ​​retrieved, and 2D spatial convolution multiplication and summation operations are performed with the thermal distribution map matrix in the horizontal and vertical directions to obtain the absolute value of the temperature gradient in the X-axis and Y-axis directions of the current pixel. The sum of the squares of the X-axis and Y-axis gradients is calculated and the square root is taken to obtain the comprehensive temperature gradient change rate of the pixel. A judgment condition mechanism is established, setting the normal body surface temperature range of the target pig to 36℃ to 39℃ and the background ambient temperature to 15℃ to 25℃. The obtained comprehensive temperature gradient change rate is compared with the thermal radiation difference boundary judgment threshold of 1.5℃ per pixel, which has been pre-calibrated through multiple pen environment tests. When the temperature gradient change rate of a pixel exceeds 1.5℃ per pixel and its own temperature is greater than 30℃, its spatial coordinate position is marked as a candidate. Thermal radiation difference boundary points; connect all marked candidate points to construct a closed thermal feature boundary contour; perform a multi-scale connected component instance segmentation algorithm along the calculated temperature gradient boundary contour; first, call a 3x3 morphological dilation kernel to perform dilation operation on the boundary region to fill small gaps, then call a 5x5 morphological erosion kernel to perform erosion operation to remove edge adhesion noise; use the four-neighbor seed point growth method to count the total number of pixels in the closed contour and establish area screening logic; compare the total number of pixels in the connected component with the area judgment lower limit benchmark value of 500 pixels. If the count is less than 500, it is judged as flying insects or environmental hotspot noise interference and the pixel value is cleared and removed; if it is greater than or equal to 500, it is confirmed as a valid living target; after traversal and judgment, the pixel grayscale value in the valid target area is uniformly set to 255, and the background pixels outside the area are uniformly set to 0. Define the physiological contour of the target in the two-dimensional image coordinate system and generate a binary three-dimensional mask image matrix containing only the pig target area.

[0026] The aforementioned multi-scale connected component instance segmentation algorithm refers to the computational logic process of clustering and boundary partitioning of pixel sets with the same pixel value and spatially adjacent locations in an image, based on graph theory and morphological principles.

[0027] The factory calibration firmware information of the binocular depth camera was retrieved, and the hardware optical parameters contained in the camera's intrinsic and extrinsic parameter matrix were extracted. The specific parameter data extracted included: X-axis focal length of 615.0, Y-axis focal length of 615.0, X-axis principal point offset of 320.0, Y-axis principal point offset of 240.0, and radial lens distortion correction coefficients k1 and k2 set to 0.01 and 0.005, respectively. Based on the extracted camera intrinsic and extrinsic parameter matrix, an inverse mapping transformation model of the spatial coordinate system was constructed. The coordinates of each effective pixel in the two-dimensional three-dimensional mask image matrix, together with the depth Z-axis value in the corresponding initial depth point cloud sequence, were substituted into the inverse perspective projection transformation equation system based on the pinhole imaging principle. Division and multiplication numerical operations were performed to map the two-dimensional pixel space system back to the three-dimensional physical space coordinate system with the camera optical center as the origin. The units were aligned by multiplying by a calibrated scaling factor of 0.001, so that the coordinate system units were unified to standard millimeters.

[0028] An iterative loop queue containing all 3D spatial points of the initial depth point cloud sequence is constructed. The 3D spatial point data in the queue is extracted one by one, and their X-axis, Y-axis, and Z-axis coordinates are read. The extracted 3D spatial point coordinates are substituted into the affine transformation matrix operation model. Through matrix multiplication and displacement addition, the target projection 2D coordinate vector corresponding to the 3D spatial point after the affine transformation is calculated. A ray intersection topology judgment logic model for the 3D mask boundary polygon is constructed. Starting from the currently calculated target projection 2D coordinate vector, a virtual test ray is generated along the positive horizontal X-axis direction of the 2D plane. All closed boundary segments of the effective area of ​​the 3D mask are traversed, and the number of geometric intersections between the virtual test ray and the boundary segments is calculated. The parity of the number of intersections is determined. If the total number of intersections is odd, the spatial point is determined to belong to the effective mask coverage area; if it is even or zero, the point is determined not to fall within the mask coverage area and a culling instruction is directly executed. For spatial points retained inside the mask, a local depth gradient mutation anomaly evaluation mechanism is established. Centered on the point, a spherical neighborhood space with a search radius of 50mm is constructed. All neighboring points falling within this neighborhood are retrieved and their depth Z values ​​are extracted. The absolute value of the difference between the current point's depth value and the average depth of all neighboring points in the neighborhood is calculated. A threshold of 100mm is set for judging abrupt changes in local depth gradient. The calculated absolute value of the difference is compared with the threshold of 100mm. If the absolute value of the difference is greater than 100mm, it indicates that the point is abruptly abnormal background noise caused by strong reflection from the metal railing, and a removal instruction is executed. If it is less than or equal to 100mm, it is confirmed as real and reliable target surface reflection data. After traversing the entire loop queue, the depth cleaning of all non-target background noise and environmental interference items is completed to extract a clean target surface point cloud data set. Experimental data shows that when the temperature gradient threshold is set to 1.5℃ per pixel and the multi-scale connected domain area threshold is set to 500 pixels, the accuracy of pig target point cloud extraction reaches 98.5%, which is 12.4% higher than the method of filtering background with a single fixed depth distance threshold.

[0029] Please see Figure 1 and Figure 3 S2: Voxelize and downsample the point cloud data and calculate the normal vector distribution. Based on the curvature features of the normal vector distribution, locate anatomical feature points. Combine the anatomical feature points according to biological connection logic to construct a skeleton model. Extract the joint coordinate vectors of consecutive frames of the skeleton model.

[0030] The specific steps of S2 are as follows: S21: Acquire point cloud data, use an octree space partitioning strategy to divide the discrete point cloud space into multiple cubic voxel grids of the same size, calculate the three-dimensional spatial centroid coordinates of all point clouds inside each voxel grid to replace the original dense point cloud, and use principal component analysis to solve the eigenvector corresponding to the minimum eigenvalue of the local covariance matrix in the neighborhood of the downsampled point cloud, and calculate the normal vector distribution.

[0031] S22: Obtain the normal vector distribution, traverse the local geometric surface of each data point after downsampling and calculate the Gaussian curvature and average curvature physical quantities, mark the region where the curvature physical quantity value exceeds the preset curvature judgment standard as candidate joint nodes, use the non-maximum suppression algorithm to filter and remove redundant neighboring candidate points in three-dimensional space, and locate anatomical feature points.

[0032] S23: Obtain anatomical feature points. Based on the prior kinematic topology and biological connection logic of the target species, use the spatial connectivity graph algorithm to establish rigid skeletal topological edges with length constraints for adjacent anatomical nodes, construct a skeleton model, and track and record the dynamic changes of the three-dimensional spatial coordinates of each key node in continuous time sampling frames to extract joint coordinate vectors.

[0033] Obtain the clean target surface point cloud data set extracted from S1. This set typically contains approximately 30,000 discrete 3D coordinate points. Construct an octree spatial partitioning algorithm executor based on a 3D spatial bounding box. Find the maximum and minimum coordinate limits of the point cloud data set along the X, Y, and Z axes to establish an initial cube bounding boundary that encloses the entire point cloud. Perform a proportional spatial cutting operation along the center positions of the three orthogonal coordinate axes, dividing the initial cube into eight equal-volume sub-cube spaces. Recursively perform the same cutting operation on each generated sub-cube, establishing a termination cutting depth judgment condition. When the side length of the sub-cube shrinks to the standard value of 20mm for the voxel mesh size, stop the recursive partitioning operation. After partitioning, the disordered... Discrete point clouds are spatially restructured into multiple sets of 20mm x 20mm x 20mm cubic voxel meshes of uniform size. All bottom-level voxel meshes are traversed, and the coordinates of all original point clouds contained within each mesh are extracted. The X, Y, and Z coordinates of all point clouds within the mesh are summed, and the summation is divided by the total number of point clouds within the mesh to calculate the arithmetic mean of each dimension. The calculated averages are combined to form the three-dimensional centroid coordinates of all point clouds within the voxel mesh. The calculated single centroid coordinates are used to replace the dense point cloud data within the original mesh, completing the point cloud downsampling operation. This reduces the overall point cloud size from 30,000 points to approximately 2,500 uniformly distributed centroids.

[0034] For the 2500 centroid point cloud data retained after downsampling, a local neighborhood retrieval KD tree data structure is established. A search region is constructed with each downsampling point as the center, and the search radius parameter is set to 50mm. The coordinate set of all neighboring point cloud data falling within the 50mm spherical neighborhood in the KD tree is extracted. The geometric center position of the coordinates of all points in the neighborhood is calculated, and the coordinates of each point are subtracted from the center coordinates to perform data decentralization. The 3x3 local covariance matrix representing the spatial dispersion state of the local point cloud is obtained by transposing the decentralized coordinate matrix and multiplying it with itself. Singular value decomposition is performed on the local covariance matrix to extract three mutually orthogonal eigenvectors and their corresponding eigenvalues. The eigenvector corresponding to the smallest eigenvalue is extracted and defined as the principal normal vector distribution feature data of the local geometric surface where the current centroid point is located, thus completing the normal vector distribution calculation of all downsampling point clouds.

[0035] Retrieve the calculated normal vector distribution set and downsampled point cloud coordinate set; select each downsampled data point one by one, and based on its 50mm neighborhood point cloud coordinates and normal vector, fit the local second-order Taylor expansion surface equation using the least squares algorithm; extract the first and second fundamental form coefficients from the fitted surface equation; use the matrix determinant division operation to solve for the two principal curvature values ​​of the local geometric surface at that point, denoted as principal curvature k1 and principal curvature k2 respectively; directly multiply principal curvature k1 and principal curvature k2 to obtain the Gaussian curvature physical quantity of that point; add principal curvature k1 and principal curvature k2 and divide by 2 to obtain the average curvature physical quantity of that point; establish a candidate joint node positioning judgment standard system; set the Gaussian curvature judgment benchmark parameter to be greater than 0.05, and set the average curvature judgment benchmark parameter to be greater than 0.1; compare the extracted Gaussian curvature and average curvature physical quantity values ​​with the preset judgment... The standard performs logical comparison and judgment; when the absolute value of the Gaussian curvature of a data point is greater than 0.05 and its average curvature is greater than 0.1, it indicates that the surface change in the region presents a local convex shape, and the data point is marked as a candidate joint node in the three-dimensional coordinate system; after traversal calculation, about 150 dense candidate node groups are output; for the candidate node groups, the non-maximum suppression algorithm is called to perform noise reduction and screening; the 150 candidate points are sorted in descending order by the magnitude of the Gaussian curvature value as the confidence score; the point with the largest Gaussian curvature at the top of the list is extracted as the core point, and a three-dimensional spatial suppression sphere is established around it, with the suppression radius parameter set to 100mm; all other suboptimal candidate points falling within the 100mm suppression sphere are detected and removed from the candidate list; the candidate list is updated and the maximum value extraction and neighborhood suppression removal operations are performed iteratively on the remaining points until the candidate list is completely cleared; the 15 most significant and non-interfering anatomical feature points on the whole body surface are accurately located and retained.

[0036] Extract the 3D spatial coordinate data of 15 identified anatomical feature points; retrieve the pre-stored prior kinematic topology rule base and biological connection logic parameter matrix of the target pig species; activate the spatial connectivity graph algorithm builder to calculate the 3D Euclidean distance between any two anatomical feature points; establish rigid skeletal topological edges with length constraints for adjacent anatomical nodes according to the biological connection logic; extract the connection length constraint parameter table and set the reasonable physiological connection distance range between the shoulder joint and elbow joint of the forelimb to be between 150mm and 250mm; compare the calculated feature point Euclidean distance with this length constraint range; if the Euclidean distance is between 150mm and 250mm and the two feature points conform to the logical definition of superior and inferior anatomical locations, then create a rigid connected line between the two points; traverse all point pairs according to this rule to construct a graph with anatomical points as graph nodes and rigid connected lines as connecting edges. A complete target pig skeleton model was constructed. A time-sliding tracking observation window was established, with a time sampling window length of 30 frames. Within 30 consecutive time sampling frames, the Kalman filter state estimation algorithm was invoked. The 3D spatial coordinates and motion velocity of the anatomical nodes in the previous frame were used as the prior prediction inputs of the state transition matrix, and the coordinates of the newly extracted feature points through curvature in the current frame were used as the posterior update measurement terms of the observation matrix. The prediction of the covariance matrix and the calculation of the Kalman gain update were performed. The dynamic change trajectory of the 3D spatial coordinates of 15 key nodes was tracked and recorded within 30 consecutive frames. A matrix tensor composed of time series and 3D coordinates was output, and a set of joint coordinate vectors with a time span of 30 frames was extracted. Experimental data showed that when the voxel mesh size was set to 20 mm and the non-maximum suppression radius of the curvature judgment standard was set to 100 mm, the localization accuracy of the key anatomical nodes in the skeleton model construction reached 95.2%.

[0037] Please see Figure 1 and Figure 4 S3: Construct a spatiotemporal behavior topology graph with spatiotemporal edges based on joint coordinate vectors, input the spatiotemporal behavior topology graph into a preset graph convolutional neural network to aggregate features to generate a motion energy matrix, and calculate the eigenvalue dispersion of the motion energy matrix.

[0038] The specific steps for S3 are as follows: S31: Obtain joint coordinate vectors, define each body joint in a single frame as a spatial graph node, and establish spatial topological edges based on the physical connection relationship of the skeleton. At the same time, establish temporal tracking connection edges with time evolution dependency between the same corresponding joints in adjacent time frames. Under the three-dimensional data analysis system that includes both time and space dimensions, construct a spatiotemporal behavior topological graph.

[0039] S32: Obtain the spatiotemporal behavior topology graph, feed it as a standard input tensor into a pre-set graph convolutional neural network model, extract the node motion trend and linkage cooperative change features in the temporal evolution dimension and spatial structure dimension respectively through multi-layer graph convolutional kernels, and perform global average pooling spatial compression and nonlinear function mapping calculation on the extracted hidden layer feature vectors to generate the motion energy matrix.

[0040] The process of generating the motion energy matrix specifically includes: The spatiotemporal behavioral topology graph is obtained and fed as a standard input tensor into a pre-set graph convolutional neural network model. Multi-layer spatial graph convolutional kernels are activated to extract the link cooperative deformation features between adjacent joint nodes at the same time.

[0041] Activate multi-layer temporal convolution kernels to extract the temporal evolution features of spatial displacement velocity and acceleration of the same joint node within a continuous sliding time window. Then, fuse and splice the spatial deformation features and temporal evolution features in the channel dimension to output the node feature matrix.

[0042] Obtain the node feature matrix, perform feature dimension reduction using an adaptive weight allocation network, construct an adjacency matrix based on node physical connectivity, and calculate the overall spatiotemporal energy distribution state. The calculation formula is as follows: ; in, Represents the kinetic energy matrix. Represents an adjacency matrix constructed based on node connectivity. Representative node feature matrix, Represents the feature weight matrix. Represents a non-linear activation function. This represents the matrix multiplication operator. Based on the above formula, it performs the summation and mapping operations on all elements within the matrix to generate the motion energy matrix.

[0043] S33: Obtain the motion energy matrix, perform singular value decomposition on the motion energy matrix to extract the set of eigenvalue vectors in each orthogonal principal component direction, calculate the data variance of all non-zero eigenvalue distribution vectors and the information entropy distribution probability after normalization, and calculate the eigenvalue dispersion by measuring the uncertainty level of the energy state and the degree of fluctuation of the target action intensity.

[0044] The process of calculating the eigenvalue dispersion specifically includes: Obtain the motion energy matrix, perform singular value decomposition on the motion energy matrix, extract the corresponding eigenvectors in each orthogonal principal component direction, and remove invalid eigenvectors that are close to zero due to computational noise.

[0045] Extract all non-zero eigenvalues ​​and normalize them to construct a dimensionless statistical sample set of eigenvalues. Calculate the mathematical mean of all eigenvalue values ​​in the statistical sample set. Calculate the squared absolute deviation between each eigenvalue and the mathematical mean. Statistically calculate the variance of the normalized non-zero eigenvalues ​​and the probability distribution of their information entropy.

[0046] By comprehensively assessing the uncertainty level of the energy state and the fluctuation degree of the target action intensity, and calculating the data index of system state disorder based on the extracted data variance and information entropy distribution probability, the calculation formula is as follows: ; in, Represents the eigenvalue dispersion. This represents the total number of non-zero eigenvalues ​​extracted. Represents the normalized first The specific values ​​of the non-zero eigenvalues This represents the mathematical mean of all normalized non-zero eigenvalues. This represents the dimensionless hyperparameter used to balance the variance and information entropy weights. This represents the information entropy value calculated based on the probability distribution of non-zero eigenvalues. This formula is used to quantify and evaluate the degree of discrete shift in the energy distribution and to calculate the eigenvalue dispersion.

[0047] Obtain the joint coordinate vector tensor structure of S2 with a continuous output time span of 30 frames and containing the 3D position information of 15 key nodes; construct a graph theory structure definer to define these 15 key body joints in a single frame as discrete spatial graph nodes of the graph structure; establish spatial topological edges based on the physical connection relationship between the torso skeleton and limb linkages established in the skeleton model, so that joints directly connected by muscles or bones in 3D space form adjacency connectivity; introduce a time span pointer variable to establish temporal tracking connection edges with temporal evolution dependency between the same corresponding joints in adjacent time frames; integrate the spatial topological connectivity attributes within a single frame with the temporal evolution tracking attributes across frames, and construct a network data structure containing dynamic motion relationships under a dual system containing the time dimension of 30 frames and the spatial dimension of 15 nodes, generating a spatiotemporal behavioral topology graph.

[0048] The generated spatiotemporal behavioral topology network data structure is extracted and rearranged into a standard input tensor with dimensions of 30 x 15 x 3, corresponding to the number of time frames, the number of joint nodes, and the three-dimensional coordinate channels, respectively. This standard input tensor is fed into a pre-set graph convolutional neural network model. The forward propagation mechanism within the network model is triggered, sequentially activating the three cascaded spatial graph convolutional layers and temporal convolutional layers in the network model. In the first layer operation, a spatial graph convolutional kernel of size 3 is activated, and the Laplacian matrix is ​​used to aggregate the coordinate feature data of neighboring joints with skeletal connections, extracting the linkage cooperative deformation features between adjacent joint nodes at the same moment during the action. The process begins by activating a one-dimensional temporal sliding convolution kernel with a kernel size of 9. This kernel performs a one-dimensional convolution operation along the time dimension on the coordinate changes of the same joint node within a continuous 9-frame sliding time window. Using the difference operation rules, the displacement difference and rate of change between adjacent coordinate points are calculated within the convolution kernel to extract the temporal evolution features of spatial displacement velocity and acceleration. The extracted link cooperative deformation feature data matrix and the displacement velocity and acceleration temporal evolution feature data matrix are then stacked and concatenated along the channel dimension. Through layer-by-layer mapping of the network, the 3-channel dimension of the original input coordinates is progressively expanded to 64 channels, outputting a node feature matrix containing high-dimensional hidden layer association information.

[0049] Obtain a node feature matrix with an output dimension of 30 x 15 x 64; input this feature matrix into the adaptive weight allocation network module; utilize the fully connected layer neural network operation nodes within the module to perform feature dimension reduction and compression operations, simplifying the 64-dimensional high-dimensional features of each node to 32-dimensional core representation features through weight matrix multiplication; simultaneously perform a global average pooling spatial compression operation along the 30-frame time dimension, fusing the time dimension features and taking the mean to eliminate the influence of time series length, generating a feature tensor of size 15 x 32 containing the spatial energy correlation dimension; construct a 15 x 15 adjacency matrix based on the physical connectivity of the pig skeleton. The values ​​of its internal elements are set according to the spatial physical connectivity of the pig skeleton. A value of 1 is assigned to the coordinates corresponding to joints with direct skeletal connections, and a value of 0 is assigned to coordinates without direct connections. The resulting adjacency matrix contains elements with values ​​of 0 or 1. A 15x32 dimension-reduced node feature matrix and the extracted feature weight matrix of size 32 x 16 Substitute it into the preset motion energy matrix calculation formula; ; in, Represents the kinetic energy matrix. Represents an adjacency matrix constructed based on node connectivity. Representative node feature matrix, Represents the feature weight matrix. Represents a non-linear activation function. Represents the matrix multiplication operator; A series of matrix multiplication operations are performed between the adjacency matrix, the node feature matrix, and the feature weight matrix to calculate an intermediate mapping matrix of dimension 15 x 16, which represents the overall spatiotemporal energy distribution state of the initial aggregation; the Sigmoid nonlinear activation function is invoked as a formula. Substituting the terms into the computational system, spatial smoothing mapping calculations are independently performed on all continuous numerical elements within the intermediate mapping matrix, compressing their absolute numerical amplitudes to a standardized continuous interval between 0 and 1. After all element mappings are completed, a real number matrix of size 15 by 16 is generated, which is the kinetic energy matrix representing the intensity of local exertion and overall coordinated movement in pigs. The result indicates that the limb movement energy of pigs within the current 30-frame time window has been converted into a stationary matrix state.

[0050] Table 1. Comparison of Parameters for Exercise Energy Assessment Results: ; Table 1 lists the specific matrix dimension parameters and feature value distributions of the spatiotemporal graph input and the output after dimensionality reduction and pooling by the graph convolutional neural network; the generated 15x16 motion energy matrix is ​​retrieved. The singular value decomposition (SVD) processor is activated for the real matrix. A real symmetric matrix with positive semi-definite properties is constructed by calculating the product of the matrix and its transpose. The eigenvalues ​​and eigenvectors of the generated real symmetric matrix are solved, and the eigenvalues ​​are sorted in descending order to extract the corresponding eigenvalue vector sets in each orthogonal principal component direction. Among the 15 extracted eigenvalues, a filtering and shielding mechanism for calculation errors is constructed, and the threshold for removing invalid eigenvalues ​​is set to be less than 0.001 in absolute value. All eigenvalue values ​​are compared, and invalid eigenvalues ​​less than 0.001 caused by truncation noise in floating-point calculation precision are forcibly removed.

[0051] The process involves: confirming the extraction and retention of specific numerical data for all non-zero eigenvalues; performing an absolute value summation operation on all retained non-zero eigenvalues ​​to obtain the total energy base; normalizing each independent non-zero eigenvalue by dividing it by the calculated total energy base to eliminate the original physical units attached to the eigenvalues, thus constructing a dimensionless eigenvalue statistical sample set whose sum is exactly 1; retrieving the sample set, summing all normalized eigenvalue values ​​and dividing by the total number of retained non-zero eigenvalues ​​to calculate the mathematical mean of all eigenvalue values ​​in the sample set; constructing a discrete statistical cyclic queue, extracting each independent normalized eigenvalue value in the sample set one by one, subtracting the calculated mathematical mean from each value to obtain the deviation value, and then multiplying the deviation values ​​themselves to calculate the absolute deviation square; summing all calculated absolute deviation squares and calculating the root mean square to obtain the data variance of the normalized non-zero eigenvalues; synchronously retrieving the normalized eigenvalue data and treating it as a probability distribution factor, multiplying the probability distribution factor by its natural logarithm to obtain the individual entropy value, and summing the negative results of all individual entropy values ​​to calculate the information entropy distribution probability.

[0052] Obtain the numerical magnitude parameters required for the formula calculation; determine the total number of extracted non-zero eigenvalues. The specific values ​​are obtained by sequentially retrieving the values ​​of each non-zero eigenvalue after normalization, which corresponds to the values ​​in the formula. Parameter; retrieve the mathematical average of all normalized non-zero eigenvalues ​​calculated above as the formula. Input data; retrieve the variance calculation results used to calculate the degree of discrete offset, and simultaneously retrieve the information entropy value obtained based on the probability distribution of non-zero eigenvalues, i.e., the value in the formula. Parameter data; regarding dimensionless hyperparameters The selection criteria are based on the tolerance of the baseline stationary fluctuation range of energy distribution in healthy pigs, and the hyperparameters are... The specific value is set to 0.5; substitute the corresponding parameter into the formula for calculating the eigenvalue dispersion; ; in, Represents the eigenvalue dispersion. This represents the total number of non-zero eigenvalues ​​extracted. Represents the normalized first The specific values ​​of the non-zero eigenvalues This represents the mathematical mean of all normalized non-zero eigenvalues. This represents the dimensionless hyperparameter used to balance the variance and information entropy weights. This represents the information entropy value calculated based on the probability distribution of non-zero eigenvalues. Total quantity Each normalized eigenvalue and its mathematical average Substitute the variance calculation term to calculate the data variance cardinality, which measures the width of the energy distribution; add the information entropy value and the balancing weight hyperparameter to the data variance cardinality. The product of the above sums is then applied; the square root operation is performed on the entire sum, and the output value is quantified as a data index representing the degree of disorder in the current pig behavior system. The experiment comprehensively assesses the uncertainty level of the energy state and the degree of fluctuation in the intensity of the target action, and calculates the specific numerical parameters of the output eigenvalue dispersion. Experimental data shows that, with a time-sliding observation window set to 30 frames and a hyperparameter balancing variance and information entropy, the experiment is successful. When set to 0.5, the accuracy rate of abnormal behavior identification reaches 96.8%.

[0053] Please see Figure 1 and Figure 5 S4: Project the eigenvalue dispersion onto the healthy manifold space and calculate the geodesic distance. Quantize the abnormal vital signs index based on the geodesic distance. If the abnormal vital signs index exceeds the dynamic safety threshold, trigger the alarm control command.

[0054] The specific steps for S4 are as follows: S41: Obtain the eigenvalue dispersion, map the discrete metric values ​​as state representation vectors to the non-Euclidean Riemannian manifold space surface structure representing the steady state of health of the organism, locate the manifold space reference origin corresponding to the historical health state mean data, solve the shortest smooth surface geometric path between the current state representation vector and the health reference origin by calculating the Riemannian metric integral path on the manifold space tangent plane, and calculate the geodesic distance.

[0055] S42: Obtain geodesic distance, call the preset physiological risk quantification mapping calculation function to perform numerical amplification and smooth normalization mapping processing on the distance index, convert the geodesic distance into a continuous value reflecting the decline of vital functions or the intensity of pathological stress, and quantify and generate an abnormal vital signs index.

[0056] The process of quantifying and generating abnormal vital signs indices specifically includes: Obtain the geodesic distance and the preset physiological risk quantification mapping function, extract the baseline metabolic decay coefficient and stress sensitivity amplification factor contained in the physiological risk quantification mapping function, and perform linear smoothing correction on the current geodesic distance through the baseline metabolic decay coefficient.

[0057] The stress sensitivity amplification factor is used to perform numerical amplification on the smoothed geodesic distance, and a normalization layer module is activated in series at the end of the calculation result to transform the numerical mapping to a standardized range of zero to one hundred, thereby quantifying and generating an abnormal vital signs index.

[0058] S43: Obtain the abnormal vital signs index, compare the currently generated index value with the dynamically adjusted safety threshold based on ambient temperature fluctuations and the target age cycle, and when the index value continuously exceeds the maximum allowable safety limit standard for a specified time observation window, send a control signal to the monitoring terminal platform to trigger an alarm control command.

[0059] Obtain the eigenvalue discrete parameters from the end output of the S3 process; construct an execution framework for a health state mapping algorithm based on a non-Euclidean Riemannian manifold structure; construct a one-dimensional state representation vector from the eigenvalue discrete values ​​and project it onto a pre-established non-Euclidean Riemannian manifold spatial surface geometric topology representing the steady-state health of pigs; retrieve historical discrete value observation data sets recorded in the system database for the specific monitoring target during the previous 7 consecutive days of normal feeding and quiet rest periods; perform weighted average numerical calculation on the historical data set and extract the discrete values. The calculated historical health status average data parameters are used to locate the corresponding geometric coordinate points in the Riemannian manifold space and establish them as the reference origin of the manifold space. The metric tensor matrix algorithm is invoked, and based on the given positive definite symmetric metric tensor, spatial derivative differentiation is performed on the tangent plane of the manifold space where the current state representation vector is located. The gradient descent optimization algorithm is used to approximate the curve along the projection direction of the surface normal vector step by step, and the integral value of the shortest smooth surface geometric path length between the current state representation vector point and the located health reference origin along the curved surface of the manifold is calculated step by step. This integral value is saved as the geodesic distance output.

[0060] The system receives and obtains the specific value of the geodesic distance calculated by the above mapping; retrieves the physiological risk quantification mapping calculation function model stored in the terminal memory; extracts the baseline metabolic decline coefficient parameter for the current tested pig, based on the percentage of natural decline of normal metabolic capacity relative to the peak period under the current target pig's age cycle, and sets the value to 1.5; simultaneously extracts the stress sensitivity amplification factor parameter, based on the positive catalytic ratio assessment index of the current environmental temperature and humidity conditions on the physiological stress response of pigs, and sets the value to 2.0; inputs the obtained geodesic distance value into the smoothing calculator, performs an algebraic multiplication operation with the baseline metabolic decline coefficient 1.5, and calculates and outputs the linear smoothing correction result value after weighting down the influence of the growth cycle baseline.

[0061] The intermediate numerical results after linear smoothing correction are obtained; the smoothed results are further algebraically multiplied with the obtained stress sensitivity amplification factor of 2.0 to perform numerical amplification calculation; the data stream after numerical amplification is transmitted and connected in series to the Sigmoid activation normalization layer processing module at the end of the computing network; the amplified result is substituted into the Sigmoid natural index algorithm to compress it to between 0 and 1, and then a fixed multiplication operation of 100 is uniformly performed to smoothly map and transform the unbounded divergent calculation values ​​into a standardized continuous evaluation interval of zero to one hundred; the integer or floating-point quantified values ​​between 0 and 100 are output to generate the vital sign abnormality index for final decision-making.

[0062] Table 2. Comparison Table of Dynamic Adjustment of Early Warning Parameters for Abnormal Vital Signs: ; Table 2 lists the core computing power coefficients and the parameters for adjusting the final safety threshold baseline when the system responds to changes in ambient temperature and age cycle. It also lists the following steps: obtaining the currently quantified abnormal vital signs index value; retrieving the measured ambient temperature data from the temperature and humidity sensor interface protocol within the monitoring area; extracting the exact age cycle number of days of the monitored target from the pig farming management database; dynamically generating the current dynamic safety threshold baseline using a linear interpolation algorithm based on the ambient temperature fluctuation and the target age cycle through a negative correction compensation equation; comparing the currently generated abnormal vital signs index value with the generated dynamic safety threshold in real time; and when the comparison result indicates that the generated abnormal index value exceeds the maximum allowable safety limit standard, activating the system's underlying preset duration observation window mechanism, setting the observation window length to 300 seconds; and cyclically determining the value within this 300-second observation window. During the cycle, the system maintains a data acquisition and calculation frequency of once per second. If the results of 300 consecutive comparisons all indicate that the currently generated abnormal index value continuously exceeds the maximum allowable safety limit, then the system is deemed to have triggered a pre-set safety red line warning mechanism. An alarm control hexadecimal machine code data packet is immediately generated, and this alarm control machine code is encapsulated using a local area network communication protocol. This code is then used to establish a direct connection to the command transmission channel sent to the central control monitoring terminal platform of the pig farm. After the control signal data stream is sent and the backend command is transmitted, the alarm control command directly controls the audible and visual alarm relay to activate and illuminate the red alarm indicator light. Experimental data shows that, with a baseline metabolic decay coefficient set to 1.5, a stress sensitivity amplification factor set to 2.0, and a time observation window length set to 300 seconds, the comprehensive monitoring and warning accuracy of this early warning control logic framework for latent diseases and acute heat stress in pigs in large-span pens reaches 97.4%.

[0063] An image recognition-based livestock and poultry vital sign detection system is used to execute the aforementioned image recognition-based livestock and poultry vital sign detection method. The system includes: The data acquisition module controls a binocular depth camera located above the monitoring area to acquire depth point cloud sequences and infrared thermal distribution maps of livestock and poultry. Based on the temperature gradient boundary of the infrared thermal distribution map, it performs instance segmentation to generate a three-dimensional mask. The three-dimensional mask is then used to filter out the background from the depth point cloud sequence and extract the point cloud data. The model building module performs voxel downsampling on point cloud data and calculates the normal vector distribution. Based on the curvature features of the normal vector distribution, it locates anatomical feature points and combines the anatomical feature points according to biological connection logic to construct a skeleton model and extracts joint coordinate vectors. The feature calculation module constructs a spatiotemporal behavior topology graph based on joint coordinate vectors, inputs the spatiotemporal behavior topology graph into a preset graph convolutional neural network to aggregate features to generate a motion energy matrix, and calculates the eigenvalue dispersion of the motion energy matrix. The abnormal alarm module projects the eigenvalue dispersion onto the healthy manifold space and calculates the geodesic distance. Based on the geodesic distance, it generates a vital sign abnormality index. If the vital sign abnormality index exceeds the dynamic safety threshold, it triggers an alarm control command.

[0064] The above embodiments illustrate preferred embodiments of the present invention. Any equivalent adjustments to the technical solution based on software engineering methods are within the scope of protection, including but not limited to: implementing algorithm logic using different programming languages, refactoring functional modules into services, adjusting data interaction protocols, and optimizing resource scheduling strategies. Any implementation scheme derived from reasonable modifications to the data processing flow, service call chain, or system architecture layer without departing from the core technology of the present invention should be considered within the protection scope defined by the technical solution of the present invention.

Claims

1. A method for detecting vital signs in livestock and poultry based on image recognition, characterized in that, Includes the following steps: S1: Control the binocular depth camera located above the monitoring area to acquire the depth point cloud sequence and infrared thermal distribution map of livestock and poultry. Perform instance segmentation based on the temperature gradient boundary of the infrared thermal distribution map to generate a three-dimensional mask. Use the three-dimensional mask to filter out the background from the depth point cloud sequence and extract the point cloud data. S2: Voxelize and downsample the point cloud data and calculate the normal vector distribution. Based on the curvature features of the normal vector distribution, locate anatomical feature points. Combine the anatomical feature points according to biological connection logic to construct a skeleton model. Extract the joint coordinate vectors of consecutive frames of the skeleton model. S3: Construct a spatiotemporal behavior topology graph with spatiotemporal edges based on the joint coordinate vectors, input the spatiotemporal behavior topology graph into a preset graph convolutional neural network to aggregate features to generate a motion energy matrix, and calculate the eigenvalue dispersion of the motion energy matrix; S4: Project the eigenvalue dispersion onto the healthy manifold space and calculate the geodesic distance. Quantize and generate a vital sign abnormality index based on the geodesic distance. If the vital sign abnormality index exceeds the dynamic safety threshold, trigger an alarm control command.

2. The method for detecting livestock and poultry vital signs based on image recognition according to claim 1, characterized in that, The specific steps of S1 are as follows: S11: Acquire the initial depth point cloud sequence of the target livestock and poultry in the monitoring area and the corresponding infrared thermal distribution map, which are synchronously collected by the binocular depth camera. By traversing and analyzing the temperature gradient change rate of each pixel in the thermal distribution map matrix, the thermal radiation difference boundary between the background environment and the living target is identified. A multi-scale connected domain instance segmentation algorithm is executed along the calculated temperature gradient boundary contour to define the physiological contour of the target in the three-dimensional coordinate system and generate a three-dimensional mask. S12: Obtain the initial depth point cloud sequence and 3D mask. Use the camera intrinsic and extrinsic parameter matrix to perform affine transformation mapping and scale alignment between the 2D pixel space system of the 3D mask and the point cloud coordinate system in the 3D physical space. Traverse all 3D spatial points in the sequence one by one and calculate the spatial mapping position. Remove non-target background noise and environmental interference items that do not fall within the mask coverage area and extract the point cloud data.

3. The method for detecting livestock and poultry vital signs based on image recognition according to claim 1, characterized in that, The specific steps of S2 are as follows: S21: Acquire point cloud data, use an octree space partitioning strategy to divide the discrete point cloud space into multiple cubic voxel grids of the same size, calculate the three-dimensional spatial centroid coordinates of all points in each voxel grid to replace the original dense point cloud, and use principal component analysis to solve the eigenvector corresponding to the minimum eigenvalue of the local covariance matrix in the neighborhood of the downsampled point cloud, and calculate the normal vector distribution. S22: Obtain the normal vector distribution, traverse the local geometric surface of each data point after downsampling and calculate the Gaussian curvature and average curvature physical quantities, mark the region where the curvature physical quantity value exceeds the preset curvature judgment standard as candidate joint nodes, use the non-maximum suppression algorithm to filter and remove redundant neighboring candidate points in three-dimensional space, and locate anatomical feature points. S23: Obtain the anatomical feature points, and based on the prior kinematic topology and biological connection logic of the target species, use the spatial connectivity graph algorithm to establish rigid skeletal topological edges with length constraints for adjacent anatomical nodes, construct a skeleton model, and track and record the dynamic changes of the three-dimensional spatial coordinates of each key node in continuous time sampling frames to extract joint coordinate vectors.

4. The method for detecting livestock and poultry vital signs based on image recognition according to claim 1, characterized in that, The specific steps of S3 are as follows: S31: Obtain the joint coordinate vector, define each body joint in a single frame as a spatial graph node and establish spatial topological edges based on the physical connection relationship of the skeleton, and at the same time establish temporal tracking connection edges with time evolution dependency between the same corresponding joints in adjacent time frames, and construct a spatiotemporal behavior topological graph under a three-dimensional data analysis system that includes both time and space dimensions. S32: Obtain the spatiotemporal behavior topology graph, feed it as a standard input tensor into a preset graph convolutional neural network model, extract the node motion trend and linkage cooperative change features in the temporal evolution dimension and spatial structure dimension respectively through multi-layer graph convolutional kernels, and perform global average pooling spatial compression and nonlinear function mapping calculation on the extracted hidden layer feature vectors to generate a motion energy matrix. S33: Obtain the motion energy matrix, perform singular value decomposition on the motion energy matrix to extract the set of eigenvalue vectors in each orthogonal principal component direction, calculate the data variance of all non-zero eigenvalue distribution vectors and the information entropy distribution probability after normalization, and calculate the eigenvalue dispersion by measuring the uncertainty level of the energy state and the degree of fluctuation of the target action intensity.

5. The method for detecting livestock and poultry vital signs based on image recognition according to claim 1, characterized in that, The specific steps of S4 are as follows: S41: Obtain the discreteness of the feature roots, map the discrete metric values ​​as state representation vectors to the non-Euclidean Riemannian manifold space surface structure representing the steady state of health of the organism, locate the reference origin of the manifold space corresponding to the historical health state mean data, solve the shortest smooth surface geometric path between the current state representation vector and the health reference origin by calculating the Riemannian metric integral path on the tangent plane of the manifold space, and calculate the geodesic distance; S42: Obtain the geodesic distance, call the preset physiological risk quantification mapping calculation function to perform numerical amplification and smooth normalization mapping processing on the distance index, and convert the geodesic distance into a continuous value reflecting the functional decline of the organism or the intensity of pathological stress, and quantify and generate a vital sign abnormality index. S43: Obtain the abnormal vital signs index, compare the currently generated index value with the dynamic safety threshold generated dynamically based on the ambient temperature fluctuation and the target age cycle, and when it is determined that the index value continuously exceeds the maximum allowable safety limit standard for a specified time observation window, send a control signal to the monitoring terminal platform to trigger an alarm control command.

6. The method for detecting livestock and poultry vital signs based on image recognition according to claim 2, characterized in that, The process of extracting point cloud data specifically includes: The initial depth point cloud sequence and 3D mask are obtained. The focal length parameter, principal point offset and lens distortion correction coefficient contained in the camera intrinsic and extrinsic parameter matrix are extracted. The calibration parameters are used to perform affine transformation mapping and scale alignment between the 2D pixel space system of the 3D mask and the point cloud coordinate system in the 3D physical space. The algorithm iterates through all three-dimensional spatial points in the initial depth point cloud sequence and calculates their two-dimensional coordinate vectors after affine transformation. It constructs a ray intersection topology judgment logic for the three-dimensional mask boundary polygon to evaluate the geometric position of each spatial point. It compares the mask region boundary with the projected coordinates, removes background noise and environmental interference terms that do not fall within the effective mask coverage area and have abrupt changes in local depth gradient, and extracts point cloud data.

7. The livestock and poultry vital sign detection method based on image recognition according to claim 4, characterized in that, The process of generating the motion energy matrix specifically includes: The spatiotemporal behavior topology graph is obtained and fed into a preset graph convolutional neural network model as a standard input tensor. Multi-layer spatial graph convolutional kernels are activated to extract the link cooperative deformation features between adjacent joint nodes at the same time. Activate multi-layer temporal convolution kernels to extract the temporal evolution features of spatial displacement velocity and acceleration of the same joint node within a continuous sliding time window. Then, fuse and splice the spatial deformation features and temporal evolution features in the channel dimension to output the node feature matrix. Obtain the node feature matrix, perform feature dimension reduction using an adaptive weight allocation network, construct an adjacency matrix based on node physical connectivity, and calculate the overall spatiotemporal energy distribution state. The calculation formula is as follows: ; in, Represents the motion energy matrix, Represents an adjacency matrix constructed based on node connectivity. Representative node feature matrix, Represents the feature weight matrix. Represents a non-linear activation function. This represents the matrix multiplication operator, which performs the summation and mapping operations on all elements within the matrix according to the above formula, generating the motion energy matrix.

8. The method for detecting livestock and poultry vital signs based on image recognition according to claim 4, characterized in that, The process of calculating the eigenvalue dispersion specifically includes: Obtain the motion energy matrix, perform singular value decomposition on the motion energy matrix, extract the corresponding eigenvectors in each orthogonal principal component direction, and remove invalid eigenvectors that are close to zero due to computational noise; Extract all non-zero eigenvalues ​​and normalize them to construct a dimensionless eigenvalue statistical sample set. Calculate the mathematical mean of all eigenvalue values ​​in the eigenvalue statistical sample set. Calculate the squared absolute deviation between each eigenvalue and the mathematical mean. Statistically calculate the data variance and information entropy distribution probability of the normalized non-zero eigenvalues. By comprehensively assessing the uncertainty level of the energy state and the fluctuation degree of the target action intensity, and calculating the data index of system state disorder based on the extracted data variance and information entropy distribution probability, the calculation formula is as follows: ; in, Represents the dispersion of the eigenvalues. This represents the total number of non-zero eigenvalues ​​extracted. Represents the normalized first The specific values ​​of the non-zero eigenvalues This represents the mathematical mean of all normalized non-zero eigenvalues. This represents the dimensionless hyperparameter used to balance the variance and information entropy weights. The value of information entropy is represented by the probability of the distribution of non-zero eigenvalues. This formula is used to quantify and evaluate the degree of discrete shift in the energy distribution and to calculate the discreteness of the eigenvalues.

9. The method for detecting livestock and poultry vital signs based on image recognition according to claim 5, characterized in that, The process of quantifying and generating the aforementioned abnormal vital signs index specifically includes: The geodesic distance and the preset physiological risk quantification mapping function are obtained. The baseline metabolic decay coefficient and stress sensitivity amplification factor contained in the physiological risk quantification mapping function are extracted. The current geodesic distance is linearly smoothed and corrected using the baseline metabolic decay coefficient. The stress sensitivity amplification factor is used to perform numerical amplification on the smoothed geodesic distance, and a normalization layer module is activated in series at the end of the calculation result to map and transform the numerical value into a standardized range of zero to one hundred, thereby quantifying and generating a vital sign abnormality index.

10. A livestock and poultry vital sign detection system based on image recognition, characterized in that, The system is used to implement the livestock and poultry vital sign detection method based on image recognition as described in any one of claims 1-9, and the system comprises: The data acquisition module controls a binocular depth camera located above the monitoring area to acquire depth point cloud sequences and infrared thermal distribution maps of livestock and poultry. Based on the temperature gradient boundary of the infrared thermal distribution map, it performs instance segmentation to generate a three-dimensional mask. The three-dimensional mask is then used to filter out the background from the depth point cloud sequence and extract the point cloud data. The model building module performs voxel downsampling on point cloud data and calculates the normal vector distribution. Based on the curvature features of the normal vector distribution, it locates anatomical feature points and combines the anatomical feature points according to biological connection logic to construct a skeleton model and extracts joint coordinate vectors. The feature calculation module constructs a spatiotemporal behavior topology graph based on the joint coordinate vector, inputs the spatiotemporal behavior topology graph into a preset graph convolutional neural network to aggregate features to generate a motion energy matrix, and calculates the eigenvalue dispersion of the motion energy matrix. The abnormal alarm module projects the eigenvalue dispersion onto the healthy manifold space and calculates the geodesic distance. Based on the geodesic distance, it quantifies and generates a vital sign abnormality index. If the vital sign abnormality index exceeds the dynamic safety threshold, it triggers an alarm control command.