Livestock health state real-time monitoring method and system based on Internet of Things

Through the multi-dimensional data acquisition and analysis method combined with biochip ear tags and video surveillance systems, an individualized health baseline model is built to identify potential health problems and provide intelligent early warnings, which solves the problems of inaccurate and timely health monitoring in the existing technology, and realizes accurate real-time monitoring of livestock health status and scientific decision-making support.

CN120530898AActive Publication Date: 2025-08-26GUIZHOU YILIAN DIGITAL TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510605094.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-26
Estimated Expiration
2045-05-12

AI Technical Summary

Technical Problem

The existing animal husbandry system has shortcomings in the continuity of data collection, multi-dimensional biometric fusion analysis, individualized health baseline establishment and abnormal pattern recognition, resulting in inaccurate and timely health monitoring, lack of intelligent data analysis and early warning mechanisms, making it difficult to support scientific decision-making and timely intervention.

Method used

Multi-dimensional data is collected through biochip ear tags and environmental sensors, combined with computer vision algorithms of video surveillance system to identify individuals and analyze behavioral characteristics, build an individualized health baseline model, use multimodal anomaly detection algorithm to identify potential health problems, and push information to breeders through intelligent early warning mechanisms to form closed-loop management.

Benefits of technology

It realizes accurate real-time monitoring of livestock health status, reduces the false alarm rate, can identify minor abnormalities in the early stage, provides scientific decision-making support, improves breeding efficiency and benefits, and the system performance continues to improve over time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120530898A_ABST
    Figure CN120530898A_ABST
Patent Text Reader

Abstract

The invention discloses a livestock health state real-time monitoring method and system based on the Internet of Things, and the method comprises the steps: collecting livestock biological data and environment parameters through a biological chip ear tag and an environment sensor, and carrying out the preprocessing, and obtaining a standardized multi-dimensional livestock data flow; in combination with image data provided by a video monitoring system, identifying livestock individuals and analyzing behavior features, and fusing biological data and visual data to generate livestock individualized feature vectors; constructing an individualized health baseline model in combination with historical health records; comparing the deviation degree between the current state and the health baseline through an anomaly detection algorithm, and identifying a potential health problem; early warning is performed according to the abnormity severity level, intervention suggestions are generated, early warning information is pushed to the breeding personnel through multiple channels, and response measures and results are recorded to form closed-loop management. According to the invention, accurate real-time monitoring of the health state of the livestock is realized, the accuracy and timeliness of anomaly detection are improved, the breeding risk is reduced, and the production efficiency of animal husbandry is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of agricultural Internet of Things technology, and in particular to a real-time monitoring method and system for livestock health status based on the Internet of Things, which is mainly used for health monitoring and management in animal husbandry such as dairy cows, beef cattle, pigs or sheep. Background Art

[0002] Livestock breeding is a vital component of agriculture. With the development of modern technology, intelligent animal husbandry management has become a key approach to improving the efficiency and quality of animal husbandry. Traditional animal husbandry relies primarily on empirical observation of livestock health and behavioral characteristics. This approach suffers from issues such as high subjectivity, discontinuous observations, and incomplete data recording.

[0003] Common livestock management systems currently on the market primarily focus on production management, ear tag recognition, and basic record management. For example, some systems use RFID technology for livestock identification, acquiring basic information by scanning ear tags; others focus on feeding records and reproductive management, digitally documenting the entire breeding process.

[0004] The most advanced solutions currently available involve attaching sensors to livestock to collect a single or limited set of physiological parameters, such as body temperature or activity level, and setting simple threshold alerts. These systems can provide basic health monitoring capabilities, but due to their single data dimension and simplistic monitoring algorithms, they struggle to accurately identify complex health issues and behavioral anomalies. Furthermore, existing systems often fragment data collection and analysis, lacking consideration for individual differences in livestock. This results in low alert accuracy, high false alarm rates, and difficulty detecting early, minor health anomalies.

[0005] Furthermore, existing technologies have significant shortcomings in areas such as continuous data collection, multi-dimensional biometric fusion analysis, establishment of individualized health baselines, and identification of abnormal patterns, making it impossible to achieve accurate, real-time, and proactive monitoring of livestock health. Furthermore, the lack of intelligent data analysis and early warning mechanisms makes it difficult for breeders to make informed decisions and implement timely interventions, hindering the modernization of the livestock industry and improving breeding efficiency. Summary of the Invention

[0006] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a real-time monitoring method and system for livestock health status based on the Internet of Things. Through multi-dimensional data collection and fusion analysis, individualized health baseline construction and intelligent early warning mechanism, accurate real-time monitoring of livestock health status can be achieved, the accuracy and timeliness of abnormality detection can be improved, and scientific decision-making support can be provided for breeding management.

[0007] To achieve the above objectives, the present invention provides a method for real-time monitoring of livestock health status based on the Internet of Things, comprising:

[0008] Collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and use edge computing devices to clean, reduce noise and preprocess the livestock biological data and environmental parameters to obtain standardized multi-dimensional livestock data streams;

[0009] receiving the standardized multi-dimensional livestock data stream, combining it with livestock image data provided by a video surveillance system, identifying livestock individuals using a computer vision algorithm and analyzing behavioral characteristics and body shape changes to obtain livestock visual data, and performing multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate a livestock individualized feature vector;

[0010] receiving the livestock individualized feature vector, combining it with historical health records, constructing an individualized health baseline model through a machine learning algorithm, and outputting a livestock health baseline model library;

[0011] receiving the livestock individualized feature vector and the livestock health baseline model library, comparing the deviation between the current state and the health baseline through an anomaly detection algorithm, identifying potential health problems, and outputting a health status assessment result;

[0012] Receive the health status assessment results, combine them with preset warning rules, issue graded warnings and generate intervention suggestions based on the severity of the abnormality, push warning information to breeding personnel through multiple channels, record response measures and results, and form a closed-loop management.

[0013] Preferably, livestock biological data and environmental parameters are collected by biochip ear tags and environmental sensors, and the livestock biological data and environmental parameters are cleaned, denoised, and preprocessed by edge computing devices to obtain standardized multi-dimensional livestock data streams, including:

[0014] Biochip ear tags are installed in livestock's ears to collect body temperature, heart rate, and activity data. Environmental sensors are deployed in the pens to collect temperature, humidity, and ammonia concentration data, forming an IoT sensing network covering the entire farm area.

[0015] The data collection frequency is dynamically adjusted according to the livestock activity status and system load. The collection frequency is 15 minutes / time in the static state, 3 minutes / time in the active state, and increased to 30 seconds / time in abnormal state.

[0016] Utilize the edge computing device to receive raw sensor data, perform data cleaning to remove outliers, perform wavelet transform filtering and time window sliding average processing to reduce data transmission volume;

[0017] Perform Z-score normalization on sensor data from different sources and dimensions and align them by timestamp to resolve the issue of asynchronous data collection time from multiple sources.

[0018] The standardized data is transmitted using a low-power wide area network to implement data hierarchical caching and breakpoint resumption, thereby ensuring data integrity in the event of network instability and outputting standardized multi-dimensional livestock data streams.

[0019] Preferably, the receiving of the standardized multi-dimensional livestock data stream, combining it with livestock image data provided by a video surveillance system, identifying livestock individuals using a computer vision algorithm and analyzing behavioral characteristics and body shape changes to obtain livestock visual data, and performing multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate livestock individualized feature vectors, comprises:

[0020] Receiving ear tag ID information from the standardized multi-dimensional livestock data stream, extracting basic information of the target livestock in combination with the livestock electronic archive database, and establishing a unique mapping relationship between the ear tag ID information and the livestock individual;

[0021] collecting real-time livestock image data of livestock through a camera system in the farm, and performing denoising, illumination compensation, and geometric correction preprocessing on the livestock image data to obtain preprocessed livestock image data;

[0022] Using a deep learning model to process the pre-processed livestock image data, achieve livestock target detection, individual recognition and behavior analysis, and extract livestock visual data of body characteristics and behavioral characteristics;

[0023] Extracting time domain features, frequency domain features, and statistical features based on the biological data of the standardized multidimensional livestock data stream and the livestock visual data to form a multidimensional feature set;

[0024] A multimodal fusion algorithm is used to fuse the biosensor data features of the multidimensional feature set with the visual behavioral features to generate an individualized feature vector that comprehensively reflects the health and behavioral status of the livestock.

[0025] Preferably, the livestock image data is pre-processed by denoising, illumination compensation and geometric correction, including:

[0026] Constructing a multi-scale feature pyramid, wherein a low-level network captures local features and a deep network captures global features, and extracting livestock image features including global features and local features from the livestock image data;

[0027] Mapping the extracted livestock image features into a projection domain space, separating image content from environmental artifact components in the space, so that content information and artifacts can be distinguished in the projection space;

[0028] The interactive attention module allows the global features to guide the artifact recognition of the local area, and at the same time feeds back the statistical information of the local features to guide the global artifact pattern recognition, thereby obtaining the image features after interaction;

[0029] Based on the image features after the interaction, an artifact distribution map in the original livestock image is estimated, and a residual learning method is used to generate a corrected image, retaining the original details while removing the artifacts;

[0030] Adjust the enhancement parameters and correction strength according to the image characteristics at different times and weather conditions to ensure clear livestock images in various environments.

[0031] Preferably, the receiving of the livestock individualized feature vector, combining historical health records, constructing an individualized health baseline model through a machine learning algorithm, and outputting a livestock health baseline model library comprises:

[0032] Receiving the livestock individualized feature vector, combining it with historical health data in the breeding records, and establishing a historical health data set for the livestock individual to provide training data for the individualized health baseline model;

[0033] Analyze the influence of livestock physiological cycles and environmental factors on biological parameters, establish a background model for parameter fluctuations, and improve the environmental adaptability of the individualized health baseline model;

[0034] Based on the time series model, the individualized health baseline model of each livestock is learned, its normal physiological parameter range, behavior pattern and change trend are learned, and a personalized health reference standard is formed;

[0035] Evaluate model performance through cross-validation, calculate error rate, precision, and recall rate indicators, optimize model parameters and structure of the individualized health baseline model, and improve model generalization ability;

[0036] An adaptive update mechanism for the individualized health baseline model is designed to regularly update the health baseline according to livestock growth and development stages and seasonal changes to ensure the timeliness and accuracy of the model.

[0037] Preferably, the receiving of the livestock individualized feature vector and the livestock health baseline model library, comparing the degree of deviation between the current state and the health baseline using an anomaly detection algorithm, identifying potential health problems, and outputting a health status assessment result, includes:

[0038] receiving the livestock individualized feature vector, extracting key feature parameters, and providing input data for anomaly detection;

[0039] Calling the individualized health baseline model of the corresponding livestock from the livestock health baseline model library, comparing the real-time features with the baseline model, and calculating the deviation and abnormality score of each dimension parameter;

[0040] Use multiple anomaly detection algorithms for parallel analysis and combine the results of each algorithm through ensemble learning methods to improve the accuracy and robustness of anomaly detection;

[0041] Based on the abnormality detection results, combined with expert knowledge rules, a risk assessment is performed on the current health status of the livestock to obtain the health status assessment result; wherein the health status assessment result includes four levels: normal, mild abnormality, moderate abnormality and severe abnormality;

[0042] The health status assessment results are presented in a visual manner to generate a structured abnormality alert containing abnormal dimension, degree, location and time information.

[0043] Preferably, the risk assessment of the current health status of the livestock is performed based on the abnormality detection result in combination with expert knowledge rules to obtain the health status assessment result, including:

[0044] Using a combination of infrared thermal imaging and visible light imaging, the livestock body surface is divided into multiple key areas, and the normalized difference index of different key areas of the livestock body surface is calculated to form a livestock health thermal map that reflects the body surface temperature distribution pattern and blood circulation status;

[0045] Integrating the normalized difference index, physiological parameter characteristics, behavioral characteristics, output indicators and historical health records to form a comprehensive feature vector through feature standardization and time series data alignment;

[0046] Inputting the comprehensive feature vector into a fully connected neural network, which includes multiple hidden layers and an attention mechanism to automatically learn the importance weights of different features;

[0047] Through the multi-task learning structure of the network, the evaluation results of four dimensions, namely health level classification, etiology type classification, system positioning classification and development trend classification, are simultaneously output;

[0048] The SHAP method is used to calculate the contribution value of each feature to the classification result, and a contribution waterfall chart is generated to provide an interpretable basis for health status assessment.

[0049] Preferably, the health status assessment results are received, combined with preset warning rules, graded warnings and intervention suggestions are generated according to the severity of the abnormality, warning information is pushed to the breeding staff through multiple channels, and response measures and results are recorded to form a closed-loop management, including:

[0050] Configure differentiated warning rules based on livestock species, age, and breeding objectives, including warning thresholds, warning levels, and response strategies;

[0051] Based on the health risk assessment results and warning rules, hierarchical warning information including warning levels and configurations is generated, wherein a reminder-level warning is issued for mild anomalies, a warning-level warning is issued for moderate anomalies, and an emergency-level warning is issued for severe anomalies;

[0052] Based on the graded warning information, early warning information is pushed to farmers through various channels such as application push, SMS and automatic phone notification to ensure that key warnings are delivered in a timely manner;

[0053] Generate intervention recommendations for different types of health abnormalities, including key observation points, basic treatment methods, and timing of professional veterinary intervention, and record the actual intervention measures taken by farmers;

[0054] Collect the intervention results and feedback from farmers after the warning, evaluate the accuracy and effectiveness of the warning, and continuously optimize the anomaly detection algorithm and warning rules.

[0055] Preferably, the processing of the pre-processed livestock image data using a deep learning model to achieve livestock target detection, individual identification and behavior analysis includes:

[0056] Collect multi-modal images including visible light images, infrared thermal images, depth images, and near-infrared images, perform spatial alignment and temporal synchronization to ensure that different modal images capture the same scene at the same moment, and obtain processed multi-modal image data;

[0057] Based on the processed multi-modal image data, a four-dimensional input tensor containing multiple modalities is constructed, and feature extraction is performed using a three-dimensional convolutional neural network. Convolution operations are performed in the spatial dimension and the modal dimension to learn the association pattern between different modalities and obtain multi-modal features;

[0058] Based on the multimodal features, a multi-scale three-dimensional feature extraction network is used, an encoder-decoder structure and a dilated three-dimensional convolution are adopted to expand the receptive field to capture a wider range of contextual information and output a multimodal feature map;

[0059] Based on the multimodal feature map, a multi-scale self-attention mechanism is implemented to decompose the input feature map into feature representations at multiple scales, and a self-attention map is calculated for each scale to capture the dependencies between long-range features.

[0060] Through the cross-attention modality fusion mechanism, the features of one modality guide the feature extraction process of another modality, enhancing the information exchange and mutual guidance between different modalities.

[0061] Preferably, the method is applied to the health monitoring of livestock such as dairy cows, beef cattle, pigs or sheep. By collecting and analyzing biological data, environmental parameters and behavioral data in real time, potential health risks can be identified early to provide decision support for breeding management.

[0062] The present invention also provides a real-time monitoring system for livestock health status based on the Internet of Things, comprising:

[0063] A data acquisition and preprocessing module is used to collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and use edge computing devices to perform data cleaning, noise reduction, and preprocessing on the livestock biological data and environmental parameters to obtain a standardized multi-dimensional livestock data stream;

[0064] an individual identification and feature fusion module for receiving the standardized multi-dimensional livestock data stream, combining it with livestock image data provided by the video surveillance system, identifying livestock individuals using a computer vision algorithm, analyzing behavioral characteristics and body shape changes, obtaining livestock visual data, and performing multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate livestock individual feature vectors;

[0065] A health baseline model construction module is used to receive the livestock individualized feature vector, combine it with historical health records, construct an individualized health baseline model through a machine learning algorithm, and output a livestock health baseline model library;

[0066] A health monitoring and anomaly detection module, configured to receive the livestock individualized feature vector and the livestock health baseline model library, compare the deviation between the current state and the health baseline using an anomaly detection algorithm, identify potential health problems, and output health status assessment results and anomaly alerts;

[0067] The intelligent early warning and decision support module is used to receive the health status assessment results and the abnormal alarms, combine them with preset early warning rules, grade early warnings and generate intervention suggestions based on the severity of the abnormalities, push early warning information to farmers through multiple channels, record response measures and results, and form a closed-loop management.

[0068] Preferably, the system further comprises:

[0069] Data storage module, used to store data such as livestock individual information, historical health records, biological data, environmental parameters and early warning records;

[0070] System management module, used to manage user permissions, device status and system configuration;

[0071] Communication interface module, used to realize data exchange between the system and external devices and services;

[0072] User interaction module, used to provide a graphical interface to display livestock health status and early warning information;

[0073] The data analysis module is used to conduct in-depth mining of historical data to discover potential health risk patterns.

[0074] The present invention has the following beneficial effects:

[0075] 1. It achieves real-time collection and fusion analysis of multi-dimensional data. By combining biosensing, environmental monitoring, and computer vision technology, it comprehensively captures the health status characteristics of livestock, improving the integrity and accuracy of the data.

[0076] 2. An individualized health baseline model was established, taking into account individual differences, physiological cycles, and environmental factors of livestock, making health status assessment more accurate and reducing false positives.

[0077] 3. Using advanced multimodal data processing and anomaly detection algorithms, it can identify early, minor health anomalies, providing a basis for timely intervention and reducing the occurrence and spread of diseases;

[0078] 4. A closed-loop management mechanism has been established. By recording intervention measures and their effects and continuously optimizing early warning rules and detection algorithms, system performance continues to improve over time.

[0079] 5. Provides visual and interpretable health assessment results to help farmers understand the causes of warnings, guide scientific decision-making, and improve farming efficiency and benefits;

[0080] 6. This invention solves the problems of discontinuous, inaccurate and untimely health monitoring in traditional animal husbandry through the integrated application of the Internet of Things, artificial intelligence and big data technologies, and provides technical support for the digital and intelligent transformation of animal husbandry. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0082] Figure 1 This is a flowchart of a method for real-time monitoring of livestock health status based on the Internet of Things of the present invention;

[0083] Figure 2 is a detailed flow chart of the livestock data collection and preprocessing steps of the present invention;

[0084] Figure 3It is a detailed flow chart of the steps of livestock individual identification and multi-dimensional feature fusion of the present invention;

[0085] Figure 4 is a detailed flow chart of the steps for constructing the livestock health baseline model of the present invention;

[0086] Figure 5 is a detailed flow chart of the real-time health monitoring and anomaly detection steps of the present invention;

[0087] Figure 6 It is a detailed flow chart of the intelligent early warning and decision support steps of the present invention;

[0088] Figure 7 This is a structural block diagram of the real-time monitoring system for livestock health status based on the Internet of Things of the present invention. DETAILED DESCRIPTION

[0089] The present invention will be further described in detail below with reference to the accompanying drawings and specific examples, but the embodiments of the present invention are not limited thereto.

[0090] like Figure 1 As shown, the method for real-time monitoring of livestock health status based on the Internet of Things provided by the present invention includes the following steps:

[0091] Step S1: Livestock biological data and environmental parameters are collected through biochip ear tags and environmental sensors, and edge computing equipment is used to clean, reduce noise, and preprocess the livestock biological data and environmental parameters to obtain a standardized multi-dimensional livestock data stream.

[0092] This step begins by building a comprehensive IoT sensing network within the farm. Biochip ear tags, equipped with multiple microsensors, are installed on the livestock's ears to collect biological parameters such as body temperature, heart rate, and activity level. Furthermore, an array of environmental sensors is installed at key locations within the livestock pens to measure environmental indicators such as temperature, humidity, and ammonia concentration, thereby providing a comprehensive understanding of the livestock's surroundings. To improve system energy efficiency, the system employs an intelligent frequency modulation strategy, dynamically adjusting the data collection frequency based on the livestock's behavioral state and system load. Specifically, when the livestock is stationary, the collection frequency is set to every 15 minutes to conserve energy. When activity is detected, the frequency is increased to every 3 minutes to capture more dynamic information. If the system initially determines that the livestock may be experiencing an abnormality, the frequency is further increased to every 30 seconds to ensure timely monitoring of potential health issues.

[0093] Raw data collected by sensors often contains noise, outliers, and redundant information. Direct transmission would waste network resources, so this step requires real-time preprocessing on edge computing devices. The specific processing flow includes: first, identifying and removing significant outliers using statistical thresholding; then applying wavelet transform filtering to eliminate high-frequency noise; then using a time window sliding average algorithm to compress the data and reduce the transmission burden; finally, performing Z-score normalization on data from different sources and scales to enable comparable analysis of various parameters. The processed data is aligned by timestamp to address the issue of time synchronization between multi-source data collection, forming a structured multidimensional time series data stream. To ensure reliable data transmission, the system utilizes low-power wide area network technologies (such as NB-IoT or LoRa) and implements hierarchical data caching and resumable transmission mechanisms. This ensures data integrity even in unstable network environments. Ultimately, the preprocessed, standardized multidimensional data stream is securely transmitted to a central server.

[0094] Step S2: Receive the standardized multi-dimensional livestock data stream, combine it with livestock image data provided by the video surveillance system, identify livestock individuals through a computer vision algorithm, analyze behavioral characteristics and body shape changes, obtain livestock visual data, perform multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data, and generate livestock individual feature vectors.

[0095] This step first uses electronic identification technology to extract ear tag ID information from the standardized biological data stream and match it with individual information (including breed, age, sex, reproductive status, etc.) in the livestock electronic archive database to establish a unique mapping relationship between data and individual livestock, ensuring that subsequent analysis is performed on specific livestock individuals. At the same time, a network of high-definition cameras within the farm is used to collect real-time video images of livestock from multiple angles. These raw images are often affected by factors such as uneven lighting, dust, and water vapor in the breeding environment, and require preprocessing to improve the accuracy of subsequent recognition. Preprocessing includes image denoising (using Gaussian filtering or median filtering), illumination compensation (through adaptive histogram equalization), and geometric correction (correcting perspective distortion) to ensure clear and usable image data.

[0096] For image processing in complex farming environments, a ring artifact correction technique based on global-local feature interaction in the projection domain is used. This technique first constructs a multi-scale feature pyramid to extract global features (such as overall illumination distribution and tonal balance) and local features (such as key details such as livestock outlines and ear tag areas) from the image. These features are then mapped to a specific projection domain, making it easier to separate image content from environmental artifacts in this space. An interactive attention module then uses the global features to guide artifact recognition in local areas, while local features also inversely guide global artifact pattern recognition. Based on this two-way interaction, the system accurately estimates the artifact distribution in the original image and generates a corrected image using residual learning, removing artifacts while preserving the image's effective information. Finally, the enhancement parameters are dynamically adjusted based on the current environmental conditions (daytime / nighttime, sunny / cloudy, etc.) to ensure optimal image quality under various conditions.

[0097] The preprocessed images are fed into a deep learning model (such as YOLOv5 or Faster R-CNN) to achieve livestock target detection, individual recognition, and behavioral analysis. This process involves locating each livestock in the image, identifying its identity, and analyzing its posture and behavior. The extracted visual features mainly fall into two categories: body shape features (morphological indicators such as body length, height, width, and body condition score) and behavioral features (action recognition results such as walking, lying down, eating, and ruminating, as well as statistics such as duration and frequency). To improve recognition accuracy and robustness, the system uses a livestock multimodal image segmentation technology based on 3D multi-scale self-attention and cross-attention. This technology integrates multiple imaging modalities such as visible light, infrared thermal imaging, depth images, and near-infrared images. It extracts multimodal features through a three-dimensional convolutional neural network, uses a multi-scale self-attention mechanism to capture long-range feature dependencies, and enhances the complementarity between different modalities through a cross-attention mechanism, ultimately achieving high-precision segmentation and recognition of livestock.

[0098] After acquiring biosensor and visual data, the system performs feature extraction, analyzing data characteristics from multiple dimensions: time domain (mean, variance, peak, trend, etc.), frequency domain (power spectral density, dominant frequency, frequency band energy distribution, etc.), and statistical characteristics (entropy, skewness, kurtosis, quantiles, etc.), to form a multidimensional feature set describing the livestock's status. Finally, a multimodal fusion algorithm is used to integrate features from different sources. The system uses a feature fusion network based on an attention mechanism, which can adaptively learn the importance weights of different features in different contexts. It organically combines biosensor data features with visual behavioral features to generate personalized feature vectors that comprehensively reflect the livestock's health status and behavioral characteristics, providing a foundation for the subsequent construction of health baseline models and anomaly detection.

[0099] Step S3: Receive the livestock individualized feature vector, combine it with historical health records, build an individualized health baseline model through a machine learning algorithm, and output a livestock health baseline model library.

[0100] This step first integrates multi-source historical data, including the individualized feature vectors generated in step S2 and historical health records from the livestock management system (such as vaccination status, medical history, treatment records, and production performance indicators such as milk production or weight gain), to establish a comprehensive historical health dataset for individual livestock. These datasets are organized as time series, encompassing both long-term trends and short-term fluctuations, providing rich training material for the baseline model. During the data preparation phase, the system also cleans outliers, fills in missing data, and normalizes the time series to ensure data quality. Next, the system analyzes the influence of livestock physiological cycles and environmental factors on biological parameters. Physiological parameters of livestock exhibit regular variations depending on physiological cycles (such as estrus, gestation, and lactation) and environmental factors (such as seasonal changes, temperature fluctuations, and the alternation of day and night). While these variations are not health anomalies, they can affect monitoring decisions. Through time series decomposition and periodic analysis, the system identifies and models these regular fluctuations, forming a background model for parameter fluctuations and improving the baseline model's adaptability to normal physiological changes and environmental responses.

[0101] Based on the prepared data and background models, the system uses machine learning algorithms to train an individualized health baseline model for each livestock. Specifically, the system uses deep time series models (such as LSTM, GRU and other recursive neural networks) to capture the time dependence of livestock physiological parameters and behavioral patterns. These models are able to learn the normal physiological parameter ranges, daily behavioral patterns and changing trends of these indicators over time of livestock, forming personalized health reference standards for each livestock. The model pays special attention to the correlation and coordinated change patterns between parameters, because some health problems can lead to coordinated abnormalities of multiple indicators rather than deviations of a single indicator. To ensure the quality of the model, the system uses cross-validation methods for evaluation, calculates multiple indicators such as error rate, precision, recall rate, F1 score, and optimizes model parameters and structure based on these evaluation results. The optimization process uses methods such as Bayesian optimization or grid search to systematically explore the optimal parameter combination to improve the model's generalization ability and stability under different conditions.

[0102] Taking into account the growth and development of livestock and seasonal changes in the environment, static baseline models are prone to becoming inaccurate over time. Therefore, the system has designed an adaptive update mechanism for the baseline model. This mechanism triggers model updates periodically or when significant changes in physiological status are detected, based on factors such as the livestock's growth stage (such as childhood, adulthood, and old age) and seasonal changes. The update process uses an incremental learning method, integrating newly collected data for fine-tuning while retaining the model's original knowledge to avoid catastrophic forgetting. Through this dynamic update mechanism, the system ensures that the health baseline model always reflects the current physiological state of the livestock, maintaining the model's timeliness and accuracy. Ultimately, the system outputs a dynamically updated library containing the health baseline models of all monitored livestock individuals, providing a reference benchmark for real-time health monitoring and anomaly detection.

[0103] Step S4: receiving the livestock individualized feature vector and the livestock health baseline model library, comparing the degree of deviation between the current state and the health baseline through an anomaly detection algorithm, identifying potential health problems, and outputting a health status assessment result.

[0104] This step first receives the livestock feature vector generated in real time in step S2, and extracts key feature parameters from it as input for anomaly detection. These key parameters include direct physiological indicators (such as body temperature curve, activity intensity, heart rate changes, etc.) and behavioral characteristics (such as feeding time, lying frequency, movement pattern, etc.), which together constitute a multidimensional representation of the current health status of the livestock. The individualized baseline model corresponding to the current livestock is called from the health baseline model library constructed in step S3, and the real-time features are compared with the baseline model in multiple dimensions. The comparison process not only calculates the deviation of each parameter from the normal range, but also analyzes the parameter change trend, fluctuation pattern and correlation changes between parameters to generate a comprehensive anomaly score. To improve the accuracy and robustness of anomaly detection, the system applies multiple anomaly detection algorithms in parallel, including statistical methods (such as Mahalanobis distance, CUSUM, etc.), machine learning methods (such as isolation forest, One-Class SVM, etc.) and deep learning methods (such as autoencoders, deep SVDD, etc.). Each algorithm has its own applicable scenarios and advantages. By combining the results of various algorithms through ensemble learning methods (such as weighted voting or stacked integration), the system can more comprehensively capture different types of abnormal patterns and reduce false positives and missed detections.

[0105] Based on anomaly detection results and combined with veterinary expert knowledge and rules, the system conducts a risk assessment and classification of the livestock's current health status. This process utilizes precise health status classification technology based on NDVI and a fully connected neural network. This technology innovatively applies the concept of NDVI (Normalized Difference Vegetation Index) to livestock health monitoring. By combining infrared thermal imaging with visible light imaging, it calculates the Normalized Difference Index (NDVI) for key areas of the livestock's body surface (such as the head, neck, chest, abdomen, and limbs). This creates a livestock health thermal map, similar to a "healthy vegetation map," that effectively reflects surface temperature distribution patterns, blood circulation, and metabolic activity. The system integrates these NDVI-like indices with physiological parameters, behavioral characteristics, output indicators, and historical health records to form a comprehensive feature vector describing the livestock's health status. After normalization and time-series alignment, these feature vectors are input into a specially designed fully connected neural network for health status classification. The network, which includes multiple hidden layers and an attention mechanism, automatically learns the importance of different features in different health issues. Through a multi-task learning structure, it simultaneously outputs assessment results across multiple dimensions: health level classification (completely healthy, sub-healthy, mildly abnormal, moderately abnormal, and severely abnormal), etiology classification (infectious, metabolic, traumatic, stress-related, etc.), system location classification (respiratory system, digestive system, reproductive system, locomotor system, etc.), and development trend classification (stable, improving, worsening, and fluctuating). To enhance the interpretability of the assessment results, the system uses the SHAP (SHapley Additive ExPlanations) method to calculate the contribution of each feature to the classification result, generating an intuitive contribution waterfall chart to help farmers understand the key factors leading to the current classification result.

[0106] Health assessment results are presented visually, including health status dashboards, multi-dimensional parameter trend charts, and highlighted abnormal indicators, enabling livestock owners to intuitively understand livestock health. Simultaneously, structured abnormality alerts are generated based on the assessment results, including detailed information such as the abnormality dimension (which indicators are abnormal), the degree of abnormality (how much the deviation from the normal range is), the location of the abnormality (which part or system of the livestock is abnormal), and the duration of the abnormality (when it began and how long it lasted). These health assessment results and abnormality alerts serve as input for subsequent intelligent early warning and decision support.

[0107] Step S5: Receive the health status assessment results, combine them with preset warning rules, issue graded warnings and generate intervention suggestions based on the severity of the abnormality, push warning information to breeding personnel through multiple channels, record response measures and results, and form a closed-loop management.

[0108] This step first involves personalized configuration and dynamic management of early warning rules. Differentiated early warning rules are configured based on factors such as livestock breed characteristics (e.g., dairy cows, beef cattle, pigs, sheep, etc.), age stage (e.g., juvenile, adult, and elderly), and farming objectives (e.g., milk production, fattening, and reproduction). These rules include threshold settings for triggering early warnings (e.g., a certain temperature increase, a certain percentage decrease in activity level), criteria for classifying early warning levels, and corresponding response strategies. Early warning rules support user customization and system self-learning optimization. As the system accumulates experience, early warning rules will gradually adjust to improve accuracy. Based on the health status assessment results from step S4 and the pre-set early warning rules, graded early warning messages are generated. Early warnings are categorized into three main levels: for minor anomalies, the system issues an "alert" warning, recommending increased observation frequency; for moderate anomalies, a "warning" warning, recommending preventive measures; and for severe anomalies, an "emergency" warning, recommending immediate intervention. Each early warning message includes the anomaly type, a possible health problem diagnosis, a severity assessment, and preliminary treatment recommendations, providing decision-making guidance for livestock breeders.

[0109] Based on the alert level and configuration, early warning information is pushed to relevant livestock farmers through multiple channels. For reminder-level alerts, a reminder notification may only be displayed in the management system app. For warning-level alerts, in addition to the app notification, a text message will also be sent to the responsible person. For emergency-level alerts, an app push notification, text message notification, and automatic phone voice reminder will be triggered simultaneously, ensuring that critical warnings are promptly communicated to relevant personnel and improving response efficiency. Targeted intervention recommendations are generated for different types of health abnormalities, including key observation points (symptoms and indicators that require special attention), basic treatment methods (such as feeding adjustments, isolation and observation, basic drug treatment, etc.), and the timing of professional veterinary intervention (when to seek professional veterinary assistance). These recommendations are based on the veterinary expert knowledge base and historical case analysis, and are highly practical and targeted. A recording function for the execution of intervention measures is also provided, allowing farmers to record actual measures taken, medication usage, observation results, and other information to form a complete abnormality handling file.

[0110] To continuously improve system performance, intervention results and feedback from farmers after early warnings are collected, including information such as whether the warning was accurate (whether a health problem actually existed), whether the intervention measures were effective, and whether the timing of the warning was appropriate (whether it was issued early enough). Based on this feedback, the accuracy and effectiveness of the warning are evaluated, and the anomaly detection model and warning rules are continuously optimized through machine learning algorithms. For example, if a certain type of warning is frequently confirmed as a false alarm, the system will automatically adjust the relevant thresholds or algorithm parameters; if a certain intervention measure is effective for a specific abnormal situation, the system will increase the recommendation priority of this measure in similar situations in the future. This closed-loop management mechanism enables the system to continuously learn and improve from actual applications, and the accuracy and practicality of the warnings are also improved, providing increasingly accurate health monitoring and management support for farms.

[0111] like Figure 2 As shown, step S1 livestock data collection and preprocessing specifically includes:

[0112] Step S1.1, multi-source sensor deployment: Install biochip ear tags (including temperature, acceleration, and other sensors) on the ears of livestock, and deploy environmental sensors (temperature, humidity, ammonia concentration, etc.) and positioning base stations in the pens to form an IoT perception network covering the entire area of ​​the farm, enabling comprehensive collection of livestock biological and environmental data.

[0113] Step S1.2, dynamic adjustment of data collection frequency: Based on the livestock activity status and system load, the data collection frequency is dynamically adjusted, such as 15 minutes / time in a stationary state, 3 minutes / time in an active state, and can be increased to 30 seconds / time in an abnormal state, to balance data accuracy and energy consumption and extend the service life of the equipment.

[0114] Step S1.3, edge computing preprocessing: Use the edge computing equipment in the farm to receive the raw sensor data, perform data cleaning (remove obvious outliers), noise filtering (wavelet transform filtering) and data compression (time window sliding average) to reduce data transmission volume and storage pressure.

[0115] Step S1.4, data standardization and time series alignment: Sensor data from different sources and dimensions are standardized (Z-score standardization) and aligned by timestamp to solve the problem of asynchronous time acquisition of multi-source data and form a multi-dimensional time series data stream in a standard format.

[0116] Step S1.5, transmission quality assurance: Use low-power wide area networks (NB-IoT, LoRa, etc.) to transmit data, implement data hierarchical caching and breakpoint resumption, ensure data integrity and reliability in unstable network conditions, and ultimately output standardized multi-dimensional livestock biological data streams.

[0117] like Figure 3As shown, step S2 of livestock individual identification and multi-dimensional feature fusion specifically includes:

[0118] Step S2.1, livestock electronic identification: Receive the ear tag ID information in the standardized biological data stream output by step S1, combine it with the livestock electronic archive database, extract the basic information of the target livestock (breed, age, sex, etc.), and establish a unique mapping relationship between the data and the livestock individual.

[0119] Step S2.2, video image acquisition and preprocessing: Real-time video images of livestock are collected through the camera system in the farm, and the images are preprocessed (denoising, lighting compensation, geometric correction, etc.) to improve the accuracy of subsequent recognition.

[0120] In step S2.2, the specific implementation of the livestock image data denoising, illumination compensation and geometric correction preprocessing is as follows, including:

[0121] S2.2.1 Multi-scale feature extraction: Construct a multi-scale feature pyramid, where the low-level network captures local features such as texture, and the deep network captures global features such as semantics, and extracts livestock image features containing global features and local features from the livestock image data.

[0122] Multi-scale feature extraction is the first key step in ring artifact correction. This process utilizes a deep convolutional neural network architecture, with a modified ResNet or EfficientNet backbone, to extract feature information at different levels and scales from the input livestock images. The shallow layers of the network focus on local texture features in the image, such as the texture details of the livestock's fur, the edge contours of the ear tag region, and subtle features of various body parts. These local features are crucial for accurately identifying individual livestock features and detecting minor anomalies. The deeper layers of the network, on the other hand, capture global features such as overall illumination distribution, wide-range tonal balance, and scene semantics. These features help understand the overall environmental conditions and large-scale artifact distribution patterns of the image. The system integrates these features from different levels using a feature pyramid network (FPN) to construct a comprehensive multi-scale feature representation. This pyramid structure typically includes five scale levels, with resolution gradually decreasing from 1 / 4 to 1 / 64 of the original image. This allows the system to simultaneously focus on both microscopic details and macroscopic structure in livestock images, providing a comprehensive, multi-scale feature foundation for subsequent artifact identification and correction. In livestock farm environments, this multi-scale feature extraction is particularly effective because it can simultaneously deal with large-scale uneven lighting and complex artifacts such as local fence shadows and dust reflections.

[0123] S2.2.2 Projection domain conversion: Map the extracted livestock image features to a specially designed projection domain space (such as frequency domain, wavelet domain, etc.), separate the image content and environmental artifact components in this space, and make the content information and artifacts easier to distinguish in the projection space.

[0124] Traditional image processing methods usually operate directly in the spatial domain, making it difficult to effectively separate the livestock content from environmental artifacts. This step innovatively introduces projection domain conversion technology to map the extracted image features to a specially designed projection space to achieve effective separation of content and artifacts. This conversion process relies on a set of learnable projection matrices, which are automatically optimized through network training, so that the feature distribution of livestock content and environmental artifacts in the projection space is more separated. In specific implementation, a projection conversion module containing multiple learnable linear transformation layers and nonlinear activation functions is designed. For frequency domain projection, a learnable discrete Fourier transform (DFT) or discrete wavelet transform (DWT) is used to map image features from the spatial domain to the frequency domain. In these transform domains, the main content of livestock is usually manifested as medium and low-frequency signals, while environmental artifacts such as strong light reflections and water vapor blur are mainly distributed in specific frequency bands. The system also implements a multi-channel projection mechanism, simultaneously projecting image features into multiple distinct feature spaces (such as the frequency domain, gradient domain, and color space). Artifacts are processed in parallel across multiple projection domains, ultimately fusing the processing results from each domain to enhance the comprehensiveness of the correction. This projection domain conversion technology is particularly well-suited for handling the complex lighting conditions commonly found in livestock farms, such as the large difference in light intensity between inside and outside the barn and the flare caused by sunlight penetrating fences. It effectively identifies and separates various types of environmental artifacts while preserving the details of the livestock's appearance.

[0125] S2.2.3 Global-local feature interaction: Through the interactive attention module, the global features (such as overall illumination) guide the artifact recognition of local areas (such as livestock body parts), and at the same time, the statistical information of the local features reversely guides the global artifact pattern recognition, thereby enhancing the perception ability of different types of environmental artifacts.

[0126] Environmental artifacts manifest differently in different regions of livestock images. For example, brightly lit areas are more prone to overexposure, while shadowed areas may experience loss of detail. To accurately identify these regionally distinct artifacts, an innovative global-local feature interaction mechanism was designed to enable bidirectional information flow and mutual guidance at the feature level. This mechanism first processes global features through a self-attention module to capture the illumination distribution pattern and dominant artifact types across the entire image. Then, a cross-attention module uses these global features as "queries" and interacts with local feature maps to generate an attention weight map, guiding the precise localization and identification of local artifacts. For example, when global features indicate overexposure, the interaction module will focus more on areas in the local region that may be overexposed, improving artifact correction accuracy in these areas. Furthermore, a reverse guidance mechanism is designed to feed back statistical information from local features (such as regional histograms and local gradient distributions) to the global feature processing module, helping it to more accurately understand the overall artifact characteristics of the scene. This bidirectional interaction forms an information loop, significantly enhancing the model's ability to perceive and understand complex environmental artifacts. In practical applications, this mechanism can effectively handle common challenges in livestock monitoring scenarios, such as dynamic lighting changes when livestock move at the junction of sunlight and shadow, or lighting inconsistencies between different pens, ensuring consistent image quality under various complex conditions.

[0127] S2.2.4 Artifact estimation and image reconstruction: Based on the image features after the interaction, estimate the artifact distribution map in the original livestock image, and use residual learning to generate a corrected image, retaining the original details while removing or reducing the impact of artifacts.

[0128] After feature extraction and interaction analysis, the artifact estimation and image reconstruction phase begins. First, a decoder network generates an accurate artifact distribution map based on the interacted features. This map, in the form of a heat map, identifies the location, intensity, and type of various environmental artifacts in the original image. This visual representation provides clear guidance for precise correction, enabling differentiated correction strategies for different regions. Subsequently, the system employs a residual learning strategy for image reconstruction. Unlike directly generating a complete corrected image, residual learning only predicts the difference between the original image and the ideal image (i.e., the portion requiring correction). This residual is then added to the original image to produce the final corrected result. This approach effectively avoids overcorrection and loss of detail, ensuring that only artifact areas are corrected while preserving the original information in other areas. Crucially, key identifying features of livestock, such as ear tags and body texture, are preserved. The reconstruction process is based on the conditional generative adversarial network (cGAN) framework. The generator is responsible for producing high-quality corrected images, while the discriminator evaluates the authenticity and consistency of the generated images. Adversarial training continuously improves the generated quality. To fully guarantee the quality of generated images, a combination of multiple loss functions is introduced, including pixel-level L1 loss (to ensure basic content consistency), structural similarity loss (SSIM) (to preserve important structural information), perceptual loss (to maintain high-level semantic features), and adversarial loss (to enhance visual realism). This multi-objective optimization framework ensures that the generated livestock images are both clear and realistic while retaining all key details, providing high-quality input for subsequent computer vision analysis.

[0129] S2.2.5 Adaptive enhancement strategy: Dynamically adjust enhancement parameters and correction strength according to image characteristics at different times (daytime / nighttime) and under different weather conditions to ensure optimal image quality in various environments.

[0130] Lighting conditions in livestock farming environments vary significantly over time and with weather. To address these changes, the system has designed an adaptive enhancement strategy that dynamically adjusts correction parameters and enhancement strength based on current environmental conditions. This strategy relies on two core components: an environmental feature classifier and a parameter adjustment network. The environmental feature classifier analyzes global image features to automatically identify the current scene's environmental type, including clear daytime, cloudy daytime, sufficient nighttime light, and insufficient nighttime light. The classification results serve as conditional inputs, guiding the parameter adjustment network to select the optimal processing parameter combination for the current environment. The parameter adjustment network uses a meta-learning approach to automatically generate an optimal set of processing parameters based on the environmental type, including contrast enhancement coefficients, detail enhancement strength, and shadow compensation levels. These parameters directly control the behavior of various modules in the reconstruction process, ensuring optimal image quality in all environments. For example, during bright daylight, the system may prioritize detail preservation and flare removal; while during low-light nighttime conditions, it may prioritize brightening shadow areas and enhancing contrast. Furthermore, the system implements an incremental learning mechanism that continuously collects environmental samples and correction feedback from daily operations to continuously update and optimize the environmental classifier and parameter adjustment network. This self-learning capability enables the system to increasingly adapt to the environmental characteristics of specific livestock farms, continuously improving its calibration effectiveness. Over long-term operation, the system automatically adjusts to the optimal processing parameters for each camera position, time of day, and weather conditions, ensuring stable, clear livestock images under all conditions, providing reliable visual input for subsequent individual identification and health monitoring.

[0131] Step S2.3, computer vision recognition and analysis: Use deep learning models (such as YOLOv5 and Faster R-CNN) to process the preprocessed images to achieve livestock target detection, individual recognition, and behavioral analysis, and extract visual data including body characteristics (length, height, width, etc.) and behavioral characteristics (walking, lying, feeding, etc.).

[0132] In step S2.3, the pre-processed livestock image data is processed using a deep learning model to achieve livestock target detection, individual identification, and behavior analysis, as shown below, including:

[0133] Step S2.3.1 Multimodal image acquisition and preprocessing: Acquire multimodal images including visible light images, infrared thermal imaging, depth images, and near-infrared images, perform spatial alignment and temporal synchronization to ensure that different modal images capture the same scene at the same moment, and obtain processed multimodal image data.

[0134] Multimodal image segmentation requires acquiring data from multiple imaging modalities. In livestock farming environments, a variety of highly complementary imaging devices are deployed to comprehensively capture visual information about livestock. Visible light cameras are the most basic imaging modality, capturing common visual features such as livestock appearance, color, and surface texture, providing rich details and appearance information. Infrared thermal imaging devices record the temperature distribution of livestock's body surface and operate without external light sources, providing clear animal outlines at night or in low-light environments. Thermal imaging is particularly suitable for identifying closely clustered livestock individuals, as temperature boundaries often exist between individuals, facilitating the segmentation of overlapping animals. Depth cameras use structured light or time-of-flight (ToF) technology to capture three-dimensional information about the scene, visually demonstrating the animal's body shape and spatial position. They are particularly effective in handling partial occlusion and accurately estimating livestock size. Near-infrared cameras can penetrate light dust and water vapor, providing clearer outline information in low-visibility farming environments. They can also reveal features not readily apparent in visible light, such as vein distribution. After acquisition, these multimodal images undergo a series of sophisticated preprocessing to ensure their effective fusion. First, spatial alignment is performed, aligning images captured by different cameras to the same coordinate system through camera calibration and geometric transformation. Then, temporal synchronization is performed to ensure that the different modalities capture the scene at the same instant, avoiding inconsistencies caused by livestock movement. Noise reduction is then performed based on the characteristics of each modality, such as Gaussian filtering for visible light images and median filtering for thermal imaging. Finally, images of different resolutions are unified to the same spatial dimension, forming an aligned multimodal image set that serves as input for subsequent deep feature extraction.

[0135] Step S2.3.2 3D feature extraction: Based on the processed multi-modal image data, a four-dimensional input tensor (batch × modality × height × width) containing multiple modalities is constructed, and feature extraction is performed through a three-dimensional convolutional neural network. Convolution operations are performed on the spatial dimension and modal dimension to learn the association patterns between different modalities and obtain multimodal features.

[0136] Traditional 2D convolutional networks process images from different modalities as independent channels, making it difficult to fully capture the complementary information between modalities. This step innovatively employs a 3D convolutional neural network architecture to organize images from different modalities into a 4D input tensor, enabling true multimodal joint feature extraction. Specifically, a 4D input tensor of shape (batch size × number of modalities × image height × image width) is first constructed, where the modality dimension contains different types of data, such as visible light, thermal imaging, depth images, and near-infrared images. This data organization preserves the relationship between modalities, enabling the network to learn cross-modal feature patterns. This tensor is then processed by a 3D convolutional layer. The key difference between 3D convolution and traditional 2D convolution is that its convolution kernel slides simultaneously across the spatial dimensions (height and width) and the modal dimensions, performing a three-dimensional convolution operation. This enables the network to automatically learn correlation patterns and complementary features between different modalities, such as the synergistic relationship between texture edges in visible light and temperature boundaries in thermal imaging, or the contour enhancement effect of contours in depth maps and near-infrared images. The network uses a structure similar to VGG or ResNet, but replaces standard convolutional layers with 3D convolutional layers while retaining batch normalization and activation function layers. To improve computational efficiency, the network typically starts at a higher resolution, then downsamples layer by layer to reduce the size of the feature maps, while increasing the number of channels to capture more complex feature patterns. This 3D feature extraction method greatly enhances the system's ability to integrate multimodal data, enabling it to fully leverage the strengths of different imaging techniques and laying a solid foundation for subsequent accurate livestock segmentation.

[0137] Step S2.3.3 Multi-scale representation: Based on the multimodal features, a multi-scale three-dimensional feature extraction network is used, an encoder-decoder structure and a hole three-dimensional convolution are adopted to expand the receptive field to capture a wider range of contextual information and output a multimodal feature map.

[0138] To effectively capture features at different scales, a multi-scale 3D feature extraction network was designed, employing a classic encoder-decoder architecture. The encoder consists of multiple downsampling modules, each consisting of 3D convolution, batch normalization, ReLU activation, and max pooling. This progressively reduces the spatial resolution of the feature map (typically to 1 / 16 or 1 / 32 of its original size) while increasing the number of channels (from an initial 64 to 512 or 1024 channels) to capture hierarchical features, from local details to global semantics. This design enables the network to simultaneously understand both microscopic features (such as texture at specific parts) and macroscopic structures (such as overall silhouette and body pose) of livestock. At the key encoder level, the system introduces dilated 3D convolutions. This specialized convolution operation, by inserting "holes" between kernel elements, expands the receptive field without increasing the number of parameters or computational burden. For example, a 3×3×3 convolution kernel with a dilation ratio of 2 effectively has a 5×5×5 receptive field, enabling the network to capture broader context while maintaining resolution. The decoder part gradually restores the spatial resolution of the feature map through transposed 3D convolution (sometimes also called deconvolution), and fuses the features of each layer of the encoder through skip connections to retain detailed information. This design effectively solves the problem of information loss in deep networks, ensuring that the final segmentation result contains both accurate boundary positioning and rich semantic understanding. In addition, the system also implements a feature pyramid pooling module (Feature Pyramid Pooling), which performs multi-scale pooling on the feature map (such as global pooling, 1 / 2 pooling, 1 / 4 pooling, etc.), and then upsamples and connects the pooling results to form a feature representation containing receptive field information of different scales. This multi-scale feature representation enables the system to effectively handle complex scenes such as changes in livestock size (close and long distances), partial occlusion, and group gathering in farms, significantly improving the adaptability and robustness of segmentation.

[0139] Step S2.3.4 Multi-scale self-attention mechanism: Based on the multimodal feature map, a multi-scale self-attention mechanism is implemented to decompose the input feature map into feature representations of multiple scales, calculate the self-attention map for each scale separately, and capture the dependency between long-distance features.

[0140] In multimodal image segmentation, features at different locations and scales have complex interdependencies. Traditional convolution operations, limited by their local receptive fields, struggle to effectively model these long-range relationships. To address this issue, a novel multi-scale self-attention mechanism is designed to adaptively focus on relevant features and suppress irrelevant information. Specifically, the system first decomposes the input multimodal feature map into feature representations at multiple scales and independently computes self-attention for each scale. For a single scale, the system generates query, key, and value feature maps using three independent 1×1×1 convolutional layers, each with a dimension typically 1 / 8 to 1 / 4 of the original feature channel count. A dot-product similarity matrix is ​​then calculated between the query and key, reflecting the correlation between different locations on the feature map. This matrix is ​​then normalized using a softmax function to generate attention weights. Finally, these weights are applied to the value feature map for a weighted sum, generating the attention feature output for the current scale. Unlike standard self-attention, this system's multi-scale self-attention boasts three innovative features: First, it operates in a 3D feature space, simultaneously considering the correlation between spatial position and modal dimensions, enabling both intra-modal and inter-modal attention mechanisms. Second, it independently computes attention at each scale and then integrates the multi-scale attention results through a feature fusion network, effectively handling differences in livestock body size. Finally, it introduces positional encoding, encoding the spatial position information of feature maps into queries and keys, enhancing the model's perception of spatial structure. This mechanism enables the system to capture dependencies between distant features. For example, features of a cow's head may be correlated with those of its legs. This correlation helps accurately identify the complete livestock outline, especially individual boundaries in group settings. By computing attention across modal dimensions, the system can also dynamically adjust the importance of different modalities, prioritizing the most informative modal features based on specific scene conditions. For example, it may prioritize visible light features in brightly lit conditions, while focusing on thermal imaging features at night.

[0141] Step S2.3.5 Cross-attention modal fusion: Through the cross-attention modal fusion mechanism, the features of one modality guide the feature extraction process of another modality. For example, the contour information of thermal imaging guides the enhancement of the corresponding area in the visible light feature map, thereby enhancing the information exchange and mutual guidance between different modalities.

[0142] While 3D convolution and self-attention mechanisms can initially fuse multimodal information, the complementarity and redundancy between modalities require more sophisticated modeling. The cross-attention modality fusion mechanism is specifically designed to enhance information exchange and mutual guidance between modalities, significantly improving the discriminative power of the fused features. Its core concept is to allow features from one modality to guide feature extraction in the other, enabling bidirectional learning of "what to focus on" and "how to focus" between modalities. Specifically, the system first separates the mixed multimodal features into their individual modalities (e.g., by splitting a 4D feature tensor along the modal dimension), then constructs modality pairs and computes cross-attention for each pair. In this computation, features from modality A serve as the "query," and features from modality B serve as the "key" and "value." The system calculates attention weights based on the similarity between the query and the key, then uses these weights to weight the sum of the values ​​to produce a cross-attention feature from B to A. Intuitively, this process is equivalent to: modality A asks "what should I pay attention to", and modality B answers "based on my perspective, these locations are important", and then modality A enhances the feature representation of the corresponding area based on this guidance. In the specific scenario of livestock monitoring, cross-attention shows unique advantages. For example, thermal imaging can clearly show the outline of livestock, but lacks internal details; while visible light images contain rich texture information, but the outline may be blurred in low light conditions. Through cross-attention, the contour information of thermal imaging can guide the enhancement of the corresponding area in the visible light feature map, helping the system to accurately locate the boundaries of livestock even in low light conditions; at the same time, the texture details in visible light can also guide thermal imaging to more finely distinguish between individual livestock in close contact. To further improve the fusion effect, the system implements multi-level cross-attention calculation, calculating cross-attention separately at multiple levels of the feature extraction network to capture everything from low-level texture edge correspondence to high-level semantic consistency. The system also designs an attention distillation mechanism, so that the cross-attention pattern of high-level semantic features guides the cross-attention calculation of low-level features, forming a top-down information flow, enhancing the semantic consistency of features, and ultimately generating a highly integrated multimodal feature representation, providing a solid foundation for accurate segmentation and health status analysis of livestock.

[0143] Step S2.4, multimodal data feature extraction: Based on the biological data stream of step S1 and the visual data of step S2.3, extract time domain features (mean, variance, peak, etc.), frequency domain features (power spectral density, main frequency, etc.) and statistical features (entropy, skewness, kurtosis, etc.) to form a multidimensional feature set.

[0144] After completing the visual analysis of livestock, we need to extract and fuse features from the visual data with biosensor data to form a multidimensional feature set that comprehensively describes the livestock's condition. This step first extracts features from two key data sources: the biodata stream output from step S1, which contains time series of parameters such as body temperature, heart rate, and activity level; and the visual data generated in step S2.3, which contains visual analysis results such as physical and behavioral characteristics. For biological data streams, three types of key features are extracted: time domain features reflect the basic statistical characteristics and temporal change patterns of the data, including mean (reflecting the overall level of the parameter), standard deviation (reflecting the degree of fluctuation of the parameter), maximum / minimum values ​​(reflecting extreme conditions), slope (reflecting the change trend), number of peaks (reflecting the frequency of fluctuations) and peak spacing (reflecting periodic changes); frequency domain features extract periodic patterns from time series through Fourier transform or wavelet transform, including power spectral density (showing the distribution of energy at different frequencies), main frequency (the most important periodic change frequency), frequency band energy ratio (reflecting the relative intensity of activities at different time scales), etc. These features help to identify the physiological cycles and behavioral rhythms of livestock; statistical features provide an in-depth description of the data distribution, including entropy (reflecting the complexity and uncertainty of the time series), skewness (reflecting the asymmetry of the distribution), kurtosis (reflecting the degree of "peak" or "flatness" of the distribution), quantiles (describing the distribution range of the data), etc. These features can capture subtle changes in the distribution of physiological parameters and help detect early abnormalities. For visual data, the system also extracts multidimensional features: from body shape features, it calculates proportional indicators (such as height / length ratio), body condition score trends (visual estimates of weight changes), etc.; from behavioral features, it extracts behavioral frequency (such as the number of times it eats / day), duration (such as the average duration of each lying down), and transition frequency (such as the number of standing-lying-down transitions). These visual features provide behavioral context for biological parameters, which helps to more comprehensively understand the status of livestock. After normalization and outlier processing, all features are organized into a structured multidimensional feature set, ready to enter the next feature fusion stage. This multidimensional feature extraction not only takes into account the status of a single time point, but also captures the dynamic change pattern of the time series, which can reflect the subtle changes and development trends in the health status of livestock.

[0145] Step S2.5, feature fusion and generation of individualized feature vectors: Use multimodal fusion algorithms (such as attention mechanism, graph convolutional network, etc.) to fuse the biosensor data features with visual behavior features to generate individualized feature vectors that comprehensively reflect the health and behavioral status of livestock.

[0146] After acquiring a multidimensional feature set, the key challenge is how to effectively fuse these features, originating from diverse sources and possessing varying characteristics, into a unified, individualized feature representation. This step utilizes advanced multimodal fusion algorithms to achieve a deep integration of biosensor data features with visual behavioral features. The system's fusion strategy is based on three layers: feature-level fusion, decision-level fusion, and hybrid fusion. For feature-level fusion, the system designs a feature-weighted network based on an attention mechanism, which automatically learns the importance of each feature in different contexts. For example, when detecting possible heat stress, body temperature and respiratory rate may receive higher weights; while when monitoring feeding anomalies, activity patterns and feeding behavior may be more critical. The attention mechanism calculates the interrelationships between features using a trainable parameter matrix, generating dynamic weights and enabling context-aware feature importance adjustment. Furthermore, a graph convolutional network (GCN) is introduced to model the complex dependencies between different features. In a GCN, each feature is treated as a node in a graph, and the correlations between features serve as edge weights. Through a message-passing mechanism, features can influence and reinforce each other, capturing more complex feature interaction patterns. For example, an elevated heart rate and increased activity are often normal phenomena, but an elevated heart rate and decreased activity may indicate a health problem. GCNs are able to effectively learn these conditional dependencies. In decision-level fusion, the system makes preliminary judgments on each modality individually and then fuses the results through methods such as voting or weighted averaging. Hybrid fusion, on the other hand, combines the strengths of the first two approaches, performing early fusion on some features while maintaining independent processing of others until the decision-making stage. The fusion process undergoes multiple rounds of iterative optimization to ensure that information from different sources complements rather than interferes with each other. Ultimately, the system generates a high-dimensional feature vector (typically between 200 and 500 dimensions) that comprehensively captures multiple aspects of the livestock's physiological state, behavioral patterns, and physical condition, forming a "digital fingerprint" of the animal's current condition. This individualized feature vector is both rich in information, capable of capturing subtle changes in the animal's health, and well-structured, facilitating the subsequent construction of health baseline models and the application of anomaly detection algorithms. Through this deep fusion, the system overcomes the limitations of a single data source and achieves a comprehensive and accurate representation of the livestock's health status.

[0147] like Figure 4 As shown, step S3 of constructing the livestock health baseline model specifically includes:

[0148] Step S3.1, historical data integration: Receive the livestock individual feature vector output from step S2, combine it with the historical health records (immunization, treatment, milk production, etc.) in the breeding module, and establish a historical health dataset for the livestock individuals to provide training data for the baseline model.

[0149] Establishing a comprehensive historical health dataset is the foundation for building an accurate health baseline model. This process begins by receiving the individualized livestock feature vectors output by step S2. These vectors contain multidimensional information such as the livestock's physiological parameters, behavioral characteristics, and morphological indicators, forming the core component of the monitoring data. Simultaneously, the system extracts the livestock's historical health records from the livestock management database, including vaccination history (vaccination time, vaccine type, vaccination reaction, etc.), previous disease history (type of disease, onset time, symptoms, severity, etc.), treatment records (medication information, treatment plan, recovery process, etc.), and production performance data (such as milk production curves for dairy cows and weight gain and reproductive status for beef cattle). Feeding management records are also collected, such as changes in feed formula and feed amount adjustments, which may affect the livestock's physiological status. These heterogeneous data are linked using timestamps to construct a time-series historical health archive. During the data integration process, the system applies various data cleaning techniques to address potential issues. For missing values, time series interpolation, mean filling, or forward / backward filling are used, depending on the data type. Outliers are detected and corrected using statistical methods such as the median absolute deviation (MAD) or modified Z-score. For noisy data, data curves are smoothed using techniques such as sliding average or wavelet denoising. To ensure data quality, the system also incorporates data consistency checks, such as ensuring that body temperature does not exceed the physiological range and that milk production does not exhibit non-physiological fluctuations. The cleaned and validated historical data is organized by time and labeled into different health status periods, such as normal, diseased, and recovery periods, so that the model can clearly distinguish between normal and abnormal states. Ultimately, a personalized historical health dataset is constructed for each animal. This dataset encompasses both long-term trends (such as growth and development curves and seasonal patterns) and short-term fluctuations (such as intraday rhythms and physiological responses to environmental changes), providing a comprehensive and reliable data foundation for subsequent health baseline model training.

[0150] Step S3.2, Physiological cycle and environmental factor analysis: Analyze the influence of livestock physiological cycles (such as estrus and gestation) and environmental factors (such as seasonal changes and day and night alternation) on biological parameters, establish a background model for parameter fluctuations, and improve the environmental adaptability of the baseline model.

[0151] Livestock's physiological parameters are affected by a variety of cyclical and environmental factors. While these changes are not disease-related, they can lead to numerous false alarms in health monitoring systems if not identified. This step aims to establish a background model for parameter fluctuations and distinguish normal physiological changes from potential health issues. First, the impact of various physiological cycles on parameters is analyzed. For female livestock, the cyclical effects of the estrus cycle (typically approximately 21 days) on body temperature, activity level, and behavioral patterns are tracked. Research has shown that during estrus, cattle may experience a slight increase in body temperature by 0.3-0.5°C, an increase in activity by 50%-300%, and a decrease in feeding behavior. Time series decomposition techniques are used to identify these regular changes and incorporate them into the background model. For pregnant livestock, a mapping model is established between gestational stage and physiological parameters, capturing the characteristic parameter variation patterns of different gestational stages (early, mid-, and late). For example, as pregnancy progresses, the livestock's basal metabolic rate increases, baseline body temperature may rise by 0.3-0.6°C, and activity level decreases overall, but the fluctuation pattern changes. For lactating animals, the relationship between lactation curve and physiological parameters is systematically analyzed, and parameter benchmarks for different lactation stages (peak, continuous, and decline) are established to distinguish normal lactation physiological changes from health problems.

[0152] At the same time, an in-depth analysis is conducted on the impact of environmental factors on biological parameters. Seasonal changes are one of the most significant environmental factors. The system establishes a multi-dimensional response model of seasons, temperature, humidity, and physiological parameters to capture normal adaptive changes under different climatic conditions. For example, in hot seasons, healthy livestock will show adaptive changes such as increased respiratory rate, decreased activity, and adjustments to feeding time (mostly in the early morning and evening). These are not manifestations of disease. The system collects long-term data to establish seasonal adjustment factors and dynamically adjusts the normal range of each parameter. The alternation of day and night also affects the physiological rhythm of livestock. Through continuous monitoring of biological parameters, a 24-hour physiological cycle model is established to identify the periodic effects of day and night changes on parameters such as body temperature, heart rate, and activity. Studies have shown that the body temperature of healthy cattle usually peaks in the afternoon and evening and is lowest in the morning, with a fluctuation range of up to 0.5-1.0°C. This change is a normal manifestation of the circadian rhythm. Weather changes are also an important influencing factor. The system links meteorological data with changes in biological parameters to establish a model of the impact of weather events such as air pressure changes, precipitation, and strong winds on livestock behavior and physiological parameters, so as to avoid misjudging short-term changes caused by the weather as health problems.

[0153] Through multivariate time series analysis and machine learning techniques, these cyclical and environmental influence patterns are extracted from historical data to construct a multi-factor background change model. This model, which employs techniques such as mixed-effect statistical models or conditional variational autoencoders, dynamically calculates the "expected normal range" of parameters based on the current physiological cycle phase and environmental conditions. This significantly improves the baseline model's adaptability to various non-disease factors, reduces false positives, and maintains sensitivity to true health anomalies. For example, the system won't misclassify a mild increase in respiratory rate during hot summer weather as a respiratory illness, but it can identify abnormal changes outside the seasonal adaptation range, enabling more accurate health monitoring.

[0154] Step S3.3, individualized health baseline model training: Based on machine learning algorithms (such as LSTM, GRU and other time series models), a health baseline model is trained for each livestock individual to learn its normal physiological parameter range, behavior patterns and change trends to form a personalized health reference standard.

[0155] Livestock exhibit significant physiological and behavioral differences among individuals, making it difficult to apply uniform health standards to all. Therefore, this step constructs a personalized health baseline model for each animal. Based on the historical dataset integrated in step S3.1 and the background change model established in step S3.2, the system uses a deep learning algorithm to train the personalized model. The system primarily employs recurrent neural network architectures such as long short-term memory (LSTM) and gated recurrent units (GRU). These models are particularly well-suited for processing time series data and can capture long-term dependencies and complex temporal patterns. The model structure adopts a multi-layer architecture, typically comprising two to three LSTM / GRU layers, each containing 64 to 128 hidden units, followed by batch normalization and dropout layers (with a dropout rate of 0.2-0.3) to prevent overfitting. The input layer receives a multidimensional feature vector containing information such as physiological parameters, behavioral indicators, and environmental conditions; the output layer predicts the expected parameter values ​​and their reasonable fluctuation range within a future time window. The system also incorporates an attention mechanism, enabling the model to automatically focus on the historical time points most relevant to the current prediction, improving the accuracy of time series modeling.

[0156] During training, the baseline model is trained only on data from periods identified as "healthy," avoiding incorporating abnormal patterns from illness into the normal baseline. Training utilizes a mini-batch stochastic gradient descent algorithm, typically with a batch size of 32-64. The Adam optimizer is used, with an initial learning rate of 0.001 and a learning rate decay strategy. The loss function combines mean squared error (to ensure prediction accuracy) with a smoothed L1 loss (to improve robustness to outliers). To account for the magnitude differences between parameters, the system applies appropriate weights to each feature, ensuring balanced attention to all physiological indicators. The model not only learns the normal range for each parameter but, more importantly, the correlations and patterns of co-variation between parameters. For example, increased activity is often accompanied by an increase in heart rate and respiratory rate, which is a normal physiological response. However, an increase in heart rate while activity remains constant may indicate a health issue. The system's baseline model captures these complex parameter interactions, an advantage that simple threshold monitoring cannot.

[0157] To adapt to livestock growth and seasonal changes, a sliding window training strategy is adopted, focusing on recent data while retaining the learning results of long-term patterns. For young livestock, due to their rapid growth, the model update frequency is higher and the window period is shorter; while for adult livestock, the model update is relatively slow, but special attention is paid to parameter adjustments caused by changes in the production cycle (such as the start of a new lactation period). The trained individualized health baseline model has multiple functions: predicting the expected values ​​of normal parameters of livestock under specific conditions, calculating the reasonable fluctuation range of parameters, identifying normal correlation patterns between parameters, and detecting abnormal change trends in time series. This personalized model greatly improves the accuracy of health monitoring, can adapt to the unique physiological characteristics of different livestock, and provide a reliable comparison basis for the next step of anomaly detection.

[0158] The system utilizes a multi-layered model architecture, typically consisting of 2-3 LSTM / GRU layers, each containing 64-128 hidden units. The input layer's dimensions match the feature vector length, typically 100-200 dimensions. A batch normalization layer follows the hidden layers to accelerate convergence and improve generalization, while a dropout layer (with a dropout rate of 0.2-0.3) is applied to prevent overfitting. The output layer is designed as a regression model, predicting the expected parameter values ​​and their reasonable fluctuation range within a future time window. Model training utilizes a mini-batch stochastic gradient descent algorithm, typically with a batch size of 32-64. The Adam optimizer is used, with an initial learning rate of 0.001 and a cosine annealing learning rate scheduling strategy. The loss function combines mean squared error (MSE) to ensure prediction accuracy and smoothed L1 loss to improve robustness to outliers. Weighting coefficients are assigned to different parameters to ensure balanced attention to each physiological indicator.

[0159] Step S3.4, model validation and parameter optimization: Evaluate model performance through cross-validation method, calculate indicators such as error rate, precision, recall rate, optimize model parameters and structure, and improve the generalization ability and stability of the model.

[0160] To ensure the accuracy and reliability of the healthy baseline model, the system conducts rigorous model validation and parameter optimization. This validation process utilizes a time series cross-validation approach, which respects the temporal nature of the data and avoids the "future data leakage" issue that can occur with traditional random cross-validation. Specifically, the healthy period data is divided into multiple consecutive segments in chronological order. Each validation run uses the first N segments to train the model, and the performance is verified on the N+1 segment. This process is then repeated with an additional segment of data in a sliding window. Finally, all validation results are aggregated to evaluate the overall model performance. The system evaluates model performance using metrics including mean absolute error (MAE) and root mean square error (RMSE) for continuous parameters, which measure the closeness of predicted values ​​to actual values; anomaly detection accuracy (the proportion of samples detected as anomalies that are truly anomalies), recall (the proportion of correctly detected anomalies out of all true anomalies), and F1 score (the harmonic mean of precision and recall); as well as time-sensitive metrics such as lead time (the average number of hours before anomalies are detected compared to manual identification) and anomaly persistence detection accuracy (the accuracy of detecting continuous anomalies). The system also pays special attention to the performance of the model in marginal situations, such as seasonal transitions, changes in feed formulas, and drastic environmental changes, to ensure that the model remains stable under various conditions.

[0161] Based on the validation results, the system conducts comprehensive parameter optimization to improve model performance. Parameter optimization uses the Bayesian optimization method, which efficiently explores the parameter space and can find near-optimal parameter combinations with fewer attempts. Optimized hyperparameters include network structure parameters (number of LSTM / GRU layers, number of neurons per layer, attention mechanism configuration, etc.), regularization parameters (dropout rate, L1 / L2 regularization coefficient, etc.), training parameters (learning rate, batch size, training rounds, etc.), and feature engineering parameters (time window size, feature combination weights, etc.). For each set of parameter configurations, the system conducts a complete cross-validation evaluation, comprehensively considering various performance indicators and model complexity to avoid the risk of overfitting. During the optimization process, the system will make customized adjustments based on the characteristics of different livestock. For example, for young livestock, the model may require a shorter time window and more frequent updates; for adult livestock with more stable behavioral patterns, it may be more appropriate to use a longer time window and a deeper network structure to capture complex patterns.

[0162] Optimization also includes adjustments to the model structure, such as trying different types of recurrent units (standard LSTM, bidirectional LSTM, GRU, etc.), adding residual connections to improve deep network training, and introducing temporal convolutional networks (TCN) to capture multi-scale temporal patterns. Model integration techniques are also explored, such as training multiple models with different structures or initializations, and integrating the prediction results of each model through weighted averaging or stacking integration to further improve prediction stability and accuracy. After comprehensive verification and optimization, the final individualized health baseline model achieved a high degree of accuracy and generalization ability, which can adapt to various environmental conditions and changes in physiological status, and provide a reliable reference benchmark for real-time health monitoring. The system will also regularly re-evaluate model performance to ensure that the model remains accurate as the physiological state of livestock evolves, and trigger the model update process when necessary.

[0163] Step S3.5, adaptive update of baseline model: Design an adaptive update mechanism for the baseline model, update the health baseline regularly or in a triggered manner according to factors such as livestock growth and development stages and seasonal changes, ensure the timeliness and accuracy of the model, and output a dynamically updated livestock health baseline model library.

[0164] The physiological state of livestock constantly evolves with growth, development, seasonal changes, and production cycles. Static baseline health models become ineffective over time. To address this issue, an adaptive update mechanism for the baseline model has been designed to ensure that the model always reflects the current physiological characteristics of the livestock. This mechanism includes two modes: periodic updates and triggered updates. Periodic updates are based on preset intervals, with the frequency adjusted according to the age and growth stage of the livestock. For rapidly growing young livestock (such as calves and piglets), the system performs model updates every 2-4 weeks to capture rapidly changing growth and development characteristics. For mature livestock, the update cycle can be extended to 1-3 months, but the frequency is adjusted according to the production cycle (such as lactation and dry period). Seasonal changes also trigger model updates, with additional update cycles scheduled during seasonal transitions (spring-summer, summer-autumn, autumn-winter, and winter-spring) to adapt to physiological adjustments caused by changing environmental conditions. Triggered updates are initiated based on specific events or detected status changes, such as significant adjustments to feed formulas, changes in livestock production status (such as entering a new lactation period), detected shifts in the stability of physiological parameters (such as changes in basal metabolic rate), or a decline in model performance (increased false positives or missed negatives). This dual mechanism ensures timely model updates and efficient resource utilization.

[0165] The update process employs an incremental learning strategy to avoid catastrophic forgetting. Rather than completely retraining the model, the system fine-tunes existing model parameters using newly collected health data. This approach preserves the underlying patterns already learned by the model while adapting to new data distribution characteristics. Specifically, techniques such as elastic weight consolidation are employed to impose constraints that protect important parameters from drastic changes, mitigating the forgetting of old task knowledge. For cyclical factors such as seasonality, a memory-augmented network is employed to explicitly memorize historical seasonal patterns within the model, improving its adaptability to cyclical changes. To balance the importance of new and old data, the system employs a time-weighted sampling strategy, giving more weight to recent data while not completely ignoring long-term patterns in historical data. The update process also includes ongoing model evaluation. The system maintains an independent validation dataset to monitor changes in model performance and ensure that updates truly improve, rather than degrade, model quality.

[0166] After the model update is completed, the system performs version management and deployment. Each update generates a new model version, but the system retains the previous versions as backups to prevent unexpected problems with the new model. The model deployment adopts a blue-green deployment strategy. The new version of the model runs in parallel with the old version for a period of time, and the prediction results of the two are compared. After confirming that the new model does perform better, it is completely switched. A model rollback mechanism is also implemented. If it is found that the new model performs poorly under certain specific conditions, it can be quickly restored to the previous stable version. All model versions and their performance evaluation results are recorded in the model library to form a complete evolution history. Through this dynamic update mechanism, the health baseline model in the system can continue to evolve, adapt to changes in the physiological state of livestock, and ensure the timeliness and accuracy of monitoring. All individual baseline models together constitute the livestock health baseline model library, providing a comprehensive, accurate, and personalized reference benchmark for real-time health monitoring and anomaly detection.

[0167] like Figure 5 As shown, step S4 real-time health monitoring and anomaly detection specifically includes:

[0168] Step S4.1, real-time data reception and feature extraction: Receive the livestock feature vector generated in real time in step S2, extract key feature parameters (body temperature, activity level, behavioral characteristics, etc.), and provide input data for anomaly detection.

[0169] The first step in real-time health monitoring is to continuously receive and process the livestock feature vectors generated in step S2. An efficient data stream processing pipeline has been established, capable of receiving incoming feature data in near real time (typically with a latency of no more than 30 seconds). These feature vectors contain multidimensional information, covering various aspects such as physiological parameters, behavioral characteristics, and environmental conditions. The system first verifies the integrity and validity of the received data, checking for missing data, transmission errors, or obvious outliers. For occasional data loss, short-term interpolation methods (such as linear interpolation or spline interpolation) are used to supplement missing values. For possible outliers, the system applies real-time filtering algorithms to identify and correct data points that fall outside a reasonable range or deviate significantly from recent trends. After ensuring data quality, the system extracts key feature parameters from the complete feature vectors. These parameters serve as the core input for anomaly detection. Physiological parameters include basic vital signs such as body temperature and its changing trends (e.g., fluctuation patterns over the past six hours), heart rate and its variability (the ratio of resting heart rate to active heart rate), and respiratory rate and depth. Behavioral characteristics include activity intensity (number of steps or activity counts per hour), activity pattern (time distribution between activity and rest), feeding behavior (number of feedings, duration of each feeding, and feeding intensity), rumination (number of ruminations, duration, and frequency), and social behavior (interaction patterns with the group). Environmental parameters include current temperature, humidity, THI index (temperature and humidity index), and the microenvironmental conditions of the livestock location.

[0170] The system not only focuses on static feature values ​​but also places special emphasis on time series features, capturing patterns in parameter changes over time. This includes short-term changes (trends over the last 1-6 hours), intraday patterns (24-hour cyclical changes), and recent trends (gradual changes over 3-7 days). For these time series, the system calculates features such as slope, volatility, periodicity, and mutation points. These dynamic features often better reflect changes in health status than absolute values ​​at a single point in time. The system also pays special attention to inter-feature correlations, calculating statistics such as correlation coefficients, conditional probabilities, and mutual information between parameter pairs to capture patterns in the coordinated changes of multiple parameters. For example, while increased activity normally accompanies an increase in heart rate, an abnormally elevated heart rate with unchanged activity may indicate a potential health issue. These extracted key features are standardized and organized into a structured feature set, which serves as input for subsequent anomaly detection. The system utilizes a streaming processing architecture to continuously update features. The feature set is dynamically updated with each new data arrival, ensuring that anomaly detection is based on the latest monitoring information. For computationally intensive features (such as complex time series pattern recognition), the system employs an incremental computation strategy to avoid reprocessing historical data and improve real-time processing efficiency. Through this efficient real-time data reception and feature extraction mechanism, the system can continuously generate high-quality feature representations that reflect the current status of livestock, laying a solid foundation for the next step of anomaly detection.

[0171] Step S4.2, baseline model matching and status comparison: call the individualized model of the corresponding livestock from the healthy baseline model library constructed in step S3, compare the real-time features with the baseline model, and calculate the deviation and anomaly score of each dimension parameter.

[0172] This step is the core of health monitoring, identifying potential health anomalies by accurately comparing real-time status with an individualized health baseline. First, based on the animal's unique identifier (e.g., ear tag ID), the individualized health baseline model for that animal is retrieved from the health baseline model library constructed in step S3. This process utilizes an efficient model indexing and caching mechanism to ensure rapid access to the latest model version. Simultaneously, the system also loads key metadata about the animal, such as age, breed, production stage, and recent health events. This information provides context for interpreting the model output. After the model is loaded, current environmental conditions (temperature, humidity, time of day, season, etc.) and animal status information (e.g., lactation days, pregnancy status, etc.) are input. The model dynamically adjusts the expected normal range of parameters to suit the current context. For example, in high-temperature environments, the upper limit of normal body temperature for healthy animals increases accordingly, and an increase in respiratory rate is considered a normal physiological regulatory response.

[0173] Next, the real-time feature vector extracted in step S4.1 is compared multidimensionally with the expected normal state generated by the model. This comparison process is not a simple threshold judgment, but a comprehensive assessment that considers multiple factors. For each key parameter, the standardized deviation (the difference between the actual value and the expected value divided by the expected fluctuation range) is calculated. Scores exceeding ±2 are considered potential abnormalities. The system also analyzes the temporal trend of the parameter. Even if the current value is within the normal range, a significant upward or downward trend may indicate health issues. For behavioral characteristics, the system compares the similarity of current behavioral patterns with historical normal patterns, using pattern matching algorithms to detect abnormal behavioral changes, such as interrupted feeding rhythms and abnormal activity patterns. Of particular importance, the system evaluates the synergistic relationships between parameters, detecting any abnormal parameter combinations. For example, a simultaneous increase in heart rate and body temperature coupled with a decrease in activity level often indicates health issues. The system uses conditional probability and Bayesian network models to assess the degree of abnormality in these parameter combinations, capturing complex changes in health status.

[0174] A separate anomaly score is calculated for each dimension of the comparison results, which are then weighted together to generate an overall anomaly score. This weighting takes into account the physiological importance of the parameter (e.g., changes in body temperature are generally more significant than small fluctuations in activity level), the duration of the anomaly (sustained anomalies are more concerning than occasional fluctuations), and the magnitude of the anomaly (extreme deviations are more severe than minor excursions). A time-series anomaly accumulation mechanism is also implemented. If a parameter deviates from the normal range for multiple consecutive time points, its anomaly weight gradually increases, increasing the system's sensitivity to persistent anomalies. Simultaneously, the system tracks anomaly trends, distinguishing between deteriorating and improving conditions, providing a dynamic perspective for health risk assessment. The comparison results include not only an overall anomaly score but also a detailed dimensional analysis, indicating which parameters are abnormal, the degree of abnormality, and how long the abnormality persists, providing a comprehensive basis for further health risk assessment. Through this sophisticated baseline comparison mechanism, the system can accurately identify subtle changes in livestock health status, detect potential health issues early, and create the conditions for timely intervention.

[0175] Step S4.3, application of multi-dimensional anomaly detection algorithm: Use multiple anomaly detection algorithms (such as isolation forest, one-class SVM, deep autoencoder, etc.) for parallel analysis, and integrate the results of each algorithm through ensemble learning methods to improve the accuracy and robustness of anomaly detection.

[0176] Livestock health anomalies manifest in diverse forms, making it difficult for a single algorithm to fully capture all abnormal patterns. Therefore, a multi-algorithm parallel analysis strategy is adopted to comprehensively detect potential health issues. Three categories of anomaly detection algorithms are simultaneously applied: statistical methods, traditional machine learning methods, and deep learning methods. Each category contains multiple specific algorithms, forming a comprehensive anomaly detection matrix. Statistical methods include the multivariate exponentially weighted moving average (MEWMA), which is used to detect gradual shifts in parameter means; the generalized likelihood ratio test (GLR), which excels at identifying parameter mutations; the Mahalanobis distance, which effectively detects coordinated anomalies in multidimensional features; and seasonal decomposition combined with cumulative sum charts (CUSUMs) to identify seasonally adjusted abnormal patterns. These statistical methods are computationally efficient, can provide statistically significant explanations for anomalies, and are suitable for detecting anomalies with clear patterns. Traditional machine learning methods include Isolation Forest, which quickly identifies outliers through random partitioning; One-Class Support Vector Machine (SVM), which uses boundary learning to define the distribution range of normal samples; Local Outlier Factor (LOF), which detects local outliers based on density estimation; and Elliptic Envelope, which detects anomalies assuming that the data follows a multivariate Gaussian distribution. These methods are suitable for processing medium-dimensional feature spaces and can capture nonlinear anomaly patterns. Deep learning methods include Variational Autoencoders (VAE), which detects difficult-to-reconstruct anomalies through reconstruction error; Long Short-Term Memory Autoencoders (LSTM-AE), which specifically capture anomaly patterns in time series data; Deep SVDD, which maps normal samples to the center of a high-dimensional sphere and anomalous samples away from the center; and Graph Neural Networks (GNN), which detect anomalies in the graph topology by leveraging the relationship graph structure between parameters. These deep methods are particularly suitable for anomaly detection in high-dimensional features and complex time series.

[0177] Each algorithm is configured with multiple sets of parameters, yielding a rich array of anomaly detection perspectives. To effectively integrate these algorithmic results, the system employs an ensemble learning framework. The core concept is to "pool the wisdom" and combine the judgments of multiple algorithms to arrive at more reliable anomaly detection conclusions. The system uses a weighted voting method, dynamically adjusting the weight of each algorithm based on its historical performance, with algorithms with higher accuracy receiving higher weights. Stacking ensemble technology is also introduced, training a meta-learner to integrate the outputs of each base algorithm to learn more complex combination patterns. To address inter-algorithm correlations, the system applies correlation analysis and principal component analysis to ensure that algorithms with different perspectives receive appropriate weight during the ensemble process, avoiding over-emphasis on the views of similar algorithms. The ensemble process not only focuses on the binary judgment of anomaly, but also integrates the assessments of the severity of anomalies from each algorithm to form a continuous spectrum of anomaly scores. This score design enables the system to distinguish between minor and major anomalies, providing a basis for subsequent risk stratification.

[0178] An adaptive enhancement mechanism for anomaly detection is also implemented. For situations initially identified as anomalies, the data collection frequency is dynamically increased to obtain more intensive monitoring data for secondary analysis. This feedback mechanism improves the accuracy of judgments on edge cases. The sensitivity of anomaly detection is also dynamically adjusted based on the characteristics and historical health status of different livestock. For example, for livestock with a history of illness, more sensitive detection parameters are used; while for healthy individuals with stable performance, more conservative anomaly determination criteria may be adopted to reduce false positives. Through this multi-algorithm collaborative and integrated learning-integrated anomaly detection framework, the system can accurately identify various types of health anomalies, including sudden and drastic changes, gradual and slow deterioration, periodic abnormal patterns, and multi-parameter coordinated anomalies, providing comprehensive and reliable anomaly detection support for livestock health management.

[0179] In terms of anomaly detection algorithm configuration, the Isolation Forest algorithm uses 100-200 trees, a subsampling size of 256, and a contamination parameter of 0.01. A single-class SVM uses the RBF kernel with a kernel coefficient γ of 0.1 and an anomaly ratio parameter of 0.05. A deep autoencoder adopts a symmetrical structure, with the encoder taking [input_dim, 128, 64, 32] and the decoder taking [32, 64, 128, input_dim]. A ReLU activation function is used, and anomalies are determined based on a reconstruction error threshold (typically set to the 95th percentile of the training set reconstruction error). The weights of each algorithm are initially equal and then dynamically adjusted based on historical detection accuracy. The system calculates the precision and recall of each algorithm weekly and automatically adjusts the weights based on the F1 score to ensure that high-performing algorithms have the greatest influence. To mitigate algorithmic noise, the system incorporates temporal smoothing, requiring three consecutive detections to trigger a final anomaly flag, thus avoiding false positives caused by short-term fluctuations.

[0180] Step S4.4, health risk assessment and classification: Based on the abnormality detection results and combined with expert knowledge rules, a risk assessment is conducted on the current health status of livestock, which is divided into four levels: normal, mild abnormality, moderate abnormality, and severe abnormality, and the possible types of health problems are analyzed.

[0181] Anomaly detection identifies deviations from health status, while health risk assessment further analyzes the clinical significance and urgency of these anomalies, providing a basis for decision-making in livestock management. First, based on the anomaly detection results from step S4.3, key anomaly features are extracted, including the anomaly parameter combination, anomaly duration, anomaly development trend, and anomaly degree distribution. These features form a multidimensional description of the current health status, which the system then matches and analyzes against a built-in veterinary knowledge base. This knowledge base contains hundreds of common livestock health issues and their characteristic manifestations, constructed and regularly updated by a team of veterinary experts. The matching process utilizes fuzzy logic and a rule-based reasoning system to calculate the similarity between the current anomaly pattern and various known health issues, identifying the most likely health issue type. The system also considers the moderating effects of individual livestock characteristics (such as age, breed, and production stage) and environmental factors (such as weather conditions and changes in feeding and management) on health risk. For example, the risk assessment for the same fever symptom may differ in hot weather compared to cold weather; the risk interpretation of certain anomalies may also differ between primiparous and multiparous cows.

[0182] Based on a comprehensive analysis, the current health status of livestock is classified into four risk levels. "Normal" indicates that the livestock's physiological parameters and behavioral patterns are within the expected range of their individual health baseline, with no obvious abnormalities detected. "Mild Abnormal" indicates that minor deviations or short-term fluctuations in certain parameters have been detected. These may reflect initial health changes or environmental adaptations, necessitating increased observation but not yet requiring urgent intervention. "Moderate Abnormal" indicates that a clear and persistent abnormal pattern has been detected, indicating that a potential health issue is developing. Preventive measures and consideration of professional examination are recommended. "Severe Abnormal" indicates that critical health indicator changes have been detected, such as significant abnormalities in body temperature, severe deviations in key physiological parameters, or simultaneous abnormalities in multiple systems. These changes indicate that the livestock may be at high risk and require immediate professional intervention. The system also calculates a confidence level for each risk level to reflect the reliability of the assessment results, preventing overly confident judgments when data is insufficient or patterns are unclear.

[0183] In addition to health risk stratification, a more detailed analysis of health issue types is also performed. First, a system location analysis identifies the primary physiological systems potentially affected, such as the respiratory system, digestive system, reproductive system, locomotor system, or multisystem syndromes. Next, the etiology type is inferred, assessing whether the abnormality may be attributed to infectious factors (such as bacterial or viral infections), metabolic factors (such as ketosis and hypocalcemia), trauma, stress, or nutritional factors. The system also predicts development trends, using time series analysis to determine whether health status is improving, stable, deteriorating, or fluctuating. Finally, the system generates a comprehensive health risk report, including the risk level, key abnormality parameters, possible health issue types, development trend forecasts, and a confidence assessment. This report utilizes a hierarchical design, with a top-level overview providing a concise risk overview and lower levels providing progressively more detailed diagnostic information, enabling livestock managers to obtain the appropriate depth of health status information as needed. Through this systematic health risk assessment and stratification, the system transforms complex, multi-dimensional anomaly detection results into a clinically meaningful health status assessment, providing a scientific basis for subsequent intelligent early warning and intervention decisions.

[0184] In step S4.4, based on the anomaly detection results and combined with expert knowledge rules, the specific implementation of risk assessment of the current health status of livestock is as follows, including accurate classification technology of health status based on NDVI and fully connected neural network. This technology first innovatively applies the concept of NDVI (normalized difference vegetation index) to the field of livestock health monitoring. By combining infrared thermal imaging and visible light imaging, it calculates the normalized difference index of different areas of the livestock's body surface to form a health heat map reflecting the body surface temperature distribution and blood circulation status. Then, it integrates multi-source features, including these indices, physiological parameters, behavioral characteristics, etc., and uses a fully connected neural network to perform multi-dimensional health status classification, including four dimensions: health level, cause type, system positioning, and development trend. It also provides explainable analysis, which significantly improves the accuracy and granularity of health status assessment.

[0185] The NDVI-derived index is calculated as follows: NDVI = (NIR - RED) / (NIR + RED), where NIR represents near-infrared reflectance and RED represents visible red reflectance. In livestock monitoring applications, the system innovatively applies a similar formula to thermal and visible light imagery: NDVI-like health index = (TIR - VIS) / (TIR + VIS), where TIR represents the thermal infrared image value and VIS represents the visible light image value. The system divides the livestock's body surface into 12 key areas and calculates the NDVI-like index for each area to construct a livestock health heat map.

[0186] For dairy cows, the system typically sets a normal health index range of 0.15-0.35, mild abnormalities of 0.35-0.45 or 0.10-0.15, moderate abnormalities of 0.45-0.60 or 0.05-0.10, and severe abnormalities of >0.60 or <0.05. Different body regions have corresponding fine-tuning parameters. Temperature variation patterns are also a key factor in judgment. For example, a normal cow typically maintains a temperature gradient of 2-4°C between different body regions, but this gradient undergoes characteristic changes under abnormal conditions.

[0187] In step S4.4, based on the abnormality detection results and combined with expert knowledge rules, the specific implementation of risk assessment of the current health status of the livestock is as follows, including:

[0188] S4.4.1 Innovative application of NDVI technology in livestock health monitoring: Utilizing a combination of infrared thermal imaging and visible light imaging, the livestock body surface is divided into multiple key areas (such as the head, neck, chest and abdomen, limbs, etc.), and the normalized difference index of different key areas of the livestock body surface is calculated to form a livestock health thermal map similar to a "healthy vegetation map" that reflects the body surface temperature distribution pattern, blood circulation status, and metabolic activity.

[0189] S4.4.2 Multi-source feature fusion and preprocessing: Integrate the normalized difference index, physiological parameter characteristics (such as body temperature change curve, heart rate change pattern, respiratory rate, etc.), behavioral characteristics (such as activity level changes, feeding time, rumination times, standing and lying time ratio, etc.), output indicators (such as milk production, weight gain rate, etc.) and historical health records, and form a comprehensive feature vector through feature standardization and time series data alignment.

[0190] S4.4.3 Fully connected neural network architecture and optimization: The comprehensive feature vector is input into a fully connected neural network, which contains multiple hidden layers and an attention mechanism to automatically learn the importance weights of different features. The network adopts a multi-layer perceptron structure, including an input layer, multiple hidden layers and an output layer. The ReLU activation function is used between each layer to increase the nonlinear expression capability.

[0191] S4.4.4 Detailed classification system for health status: Through the multi-task learning structure of the network, the evaluation results of four dimensions are simultaneously output, including health level classification (complete health, sub-health, mild abnormality, moderate abnormality and severe abnormality), etiology type classification (infectious, metabolic, traumatic, stressful, etc.), system location classification (respiratory system, digestive system, reproductive system, musculoskeletal system, etc.) and development trend classification (stable, improving, deteriorating and fluctuating).

[0192] S4.4.5 Interpretability and decision support: The SHAP method is used to calculate the contribution value of each feature to the classification result, and a contribution waterfall chart is generated to intuitively show which indicator abnormalities lead to the current classification result, providing an interpretable basis for health status assessment.

[0193] Step S4.5, health status visualization and abnormal alarm generation: present the health status assessment results in an intuitive visual manner, generate structured abnormal alarms containing information such as abnormal dimension, degree, location and time, and output the health status assessment results and abnormal alarms.

[0194] like Figure 6 As shown, step S5 intelligent early warning and decision support step specifically includes:

[0195] Step S5.1, early warning rule configuration and management: Receive the health status assessment results of step S4, and configure differentiated early warning rules based on factors such as livestock breed, age, and breeding goals, including early warning thresholds, early warning levels, and response strategies, to achieve personalized and precise early warnings.

[0196] Step S5.2, multi-level warning information generation: Based on the health risk assessment results and warning rules, generate graded warning information: mild abnormalities issue reminder-level warnings, moderate abnormalities issue warning-level warnings, and severe abnormalities issue emergency-level warnings, along with possible health problem diagnoses and treatment suggestions.

[0197] Step S5.3, multi-channel warning information push: According to the warning level and configuration, the warning information is pushed to the breeding personnel through multiple channels (APP push, SMS, automatic phone notification, etc.) to ensure that key warnings can be conveyed in time and improve response efficiency.

[0198] Step S5.4, intervention measure recommendations and implementation tracking: Generate specific intervention recommendations for different types of health abnormalities, including key observation points, basic treatment methods, and timing of professional veterinary intervention, and record the actual intervention measures and implementation results of the breeders.

[0199] Step S5.5, early warning effect feedback and continuous optimization: Collect intervention results and feedback from farmers after the early warning, evaluate the accuracy and effectiveness of the early warning, continuously optimize the anomaly detection algorithm and early warning rules, form a closed-loop management mechanism, and improve the overall performance of the system.

[0200] like Figure 7 As shown, the present invention also provides a real-time monitoring system for livestock health status based on the Internet of Things, comprising:

[0201] The data acquisition and preprocessing module 100 is used to collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and use edge computing devices to perform data cleaning, noise reduction, and preprocessing on the livestock biological data and environmental parameters to obtain a standardized multi-dimensional livestock data stream;

[0202] The individual identification and feature fusion module 200 is configured to receive the standardized multi-dimensional livestock data stream, combine it with livestock image data provided by the video surveillance system, identify livestock individuals using a computer vision algorithm, analyze behavioral characteristics and body shape changes, obtain livestock visual data, and perform multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate a livestock individual feature vector;

[0203] A health baseline model construction module 300 is configured to receive the livestock individualized feature vector, combine it with historical health records, construct an individualized health baseline model through a machine learning algorithm, and output a livestock health baseline model library;

[0204] The health monitoring and anomaly detection module 400 is configured to receive the livestock individualized feature vector and the livestock health baseline model library, compare the deviation between the current state and the health baseline using an anomaly detection algorithm, identify potential health problems, and output health status assessment results and anomaly alerts;

[0205] The intelligent early warning and decision support module 500 is used to receive the health status assessment results and the abnormal alarms, combine them with preset early warning rules, grade early warnings and generate intervention suggestions according to the severity of the abnormalities, push early warning information to breeding personnel through multiple channels, record response measures and results, and form a closed-loop management.

[0206] The system further comprises:

[0207] Data storage module 600, for storing data such as livestock individual information, historical health records, biological data, environmental parameters and warning records;

[0208] System management module 700, used to manage user permissions, device status and system configuration;

[0209] Communication interface module 800, used to implement data exchange between the system and external devices and services;

[0210] User interaction module 900, for providing a graphical interface to display livestock health status and warning information;

[0211] The data analysis module 1000 is used to conduct in-depth mining of historical data to discover potential health risk patterns.

[0212] It should be noted that the ring artifact correction technique in this method, based on the interaction of global and local features in the projection domain, is described below. It is primarily used to address image quality issues caused by complex lighting conditions in livestock farms. By interactively guiding global and local features in the projection domain, it achieves adaptive image enhancement and correction. This technique, as a substep of step S2.2, "Video Image Acquisition and Preprocessing," in the original technical solution, intelligently corrects common environmental artifacts in surveillance video images, improving the accuracy of subsequent visual analysis.

[0213] The precise livestock health status classification technology based on NDVI and a fully connected neural network in this method is shown below. By innovatively applying the concept of NDVI (Normalized Difference Vegetation Index) to livestock health monitoring, a similar NDVI health index system has been developed. This technology, implemented in step S4.4, "Health Risk Assessment and Classification," can more accurately describe livestock health and improve the accuracy and granularity of health status classification.

[0214] The following describes the livestock multimodal image segmentation technique based on 3D multi-scale self-attention and cross-attention in this method. By integrating multiple imaging modalities and an advanced attention mechanism, it achieves high-precision and robust livestock segmentation, providing a solid foundation for subsequent health feature extraction and analysis. This technique, implemented in step S2.3 (computer vision recognition and analysis), addresses the poor performance of traditional image segmentation methods in complex environments.

[0215] The IoT-based real-time livestock health status monitoring method and system described in the present invention are applied to the health monitoring of livestock such as dairy cows, beef cattle, pigs, or sheep. By real-time collection and analysis of biological data, environmental parameters, and behavioral data, potential health risks can be identified early, providing decision support for breeding management.

[0216] The present invention has described specific embodiments, but the contents are only preferred embodiments of the present invention and should not be used to limit the scope of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A method for real-time monitoring of livestock health status based on the Internet of Things, characterized in that: include: Collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and use edge computing devices to clean, reduce noise and preprocess the livestock biological data and environmental parameters to obtain standardized multi-dimensional livestock data streams; receiving the standardized multi-dimensional livestock data stream, combining it with livestock image data provided by a video surveillance system, identifying livestock individuals using a computer vision algorithm and analyzing behavioral characteristics and body shape changes to obtain livestock visual data, and performing multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate a livestock individualized feature vector; receiving the livestock individualized feature vector, combining it with historical health records, constructing an individualized health baseline model through a machine learning algorithm, and outputting a livestock health baseline model library; receiving the livestock individualized feature vector and the livestock health baseline model library, comparing the deviation between the current state and the health baseline through an anomaly detection algorithm, identifying potential health problems, and outputting a health status assessment result; Receive the health status assessment results, combine them with preset warning rules, issue graded warnings and generate intervention suggestions based on the severity of the abnormality, push warning information to breeding personnel through multiple channels, record response measures and results, and form a closed-loop management.

2. The method according to claim 1, characterized in that Livestock biological data and environmental parameters are collected through biochip ear tags and environmental sensors, and edge computing devices are used to clean, reduce noise, and preprocess the livestock biological data and environmental parameters to obtain standardized multi-dimensional livestock data streams, including: Biochip ear tags are installed in livestock's ears to collect body temperature, heart rate, and activity data. Environmental sensors are deployed in the pens to collect temperature, humidity, and ammonia concentration data, forming an IoT sensing network covering the entire farm area. The data collection frequency is dynamically adjusted according to the livestock activity status and system load. The collection frequency is 15 minutes / time in the static state, 3 minutes / time in the active state, and increased to 30 seconds / time in abnormal state. Utilize the edge computing device to receive raw sensor data, perform data cleaning to remove outliers, perform wavelet transform filtering and time window sliding average processing to reduce data transmission volume; Perform Z-score normalization on sensor data from different sources and dimensions and align them by timestamp to resolve the issue of asynchronous data collection time from multiple sources. The standardized data is transmitted using a low-power wide area network to implement data hierarchical caching and breakpoint resumption, thereby ensuring data integrity in the event of network instability and outputting standardized multi-dimensional livestock data streams.

3. The method according to claim 1, characterized in that The method comprises: receiving the standardized multi-dimensional livestock data stream, combining the livestock image data provided by the video surveillance system, identifying livestock individuals through a computer vision algorithm, analyzing behavioral characteristics and body shape changes, obtaining livestock visual data, and performing multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate livestock individual feature vectors, including: Receiving ear tag ID information from the standardized multi-dimensional livestock data stream, extracting basic information of the target livestock in combination with the livestock electronic archive database, and establishing a unique mapping relationship between the ear tag ID information and the livestock individual; collecting real-time livestock image data of livestock through a camera system in the farm, and performing denoising, illumination compensation, and geometric correction preprocessing on the livestock image data to obtain preprocessed livestock image data; Using a deep learning model to process the pre-processed livestock image data, achieve livestock target detection, individual recognition and behavior analysis, and extract livestock visual data of body characteristics and behavioral characteristics; Extracting time domain features, frequency domain features, and statistical features based on the biological data of the standardized multidimensional livestock data stream and the livestock visual data to form a multidimensional feature set; A multimodal fusion algorithm is used to fuse the biosensor data features of the multidimensional feature set with the visual behavioral features to generate an individualized feature vector that comprehensively reflects the health and behavioral status of the livestock.

4. The method according to claim 3, characterized in that The livestock image data is subjected to denoising, illumination compensation and geometric correction preprocessing, including: Constructing a multi-scale feature pyramid, wherein a low-level network captures local features and a deep network captures global features, and extracting livestock image features including global features and local features from the livestock image data; Mapping the extracted livestock image features into a projection domain space, separating image content from environmental artifact components in the space, so that content information and artifacts can be distinguished in the projection space; The interactive attention module allows the global features to guide the artifact recognition of the local area, and at the same time feeds back the statistical information of the local features to guide the global artifact pattern recognition, thereby obtaining the image features after interaction; Based on the image features after the interaction, an artifact distribution map in the original livestock image is estimated, and a residual learning method is used to generate a corrected image, retaining the original details while removing the artifacts; Adjust the enhancement parameters and correction strength according to the image characteristics at different times and weather conditions to ensure clear livestock images in various environments.

5. The method according to claim 1, characterized in that The receiving of the livestock individualized feature vector, combining it with historical health records, building an individualized health baseline model through a machine learning algorithm, and outputting a livestock health baseline model library includes: Receiving the livestock individualized feature vector, combining it with historical health data in the breeding records, and establishing a historical health data set for the livestock individual to provide training data for the individualized health baseline model; Analyze the influence of livestock physiological cycles and environmental factors on biological parameters, establish a background model for parameter fluctuations, and improve the environmental adaptability of the individualized health baseline model; Based on the time series model, the individualized health baseline model of each livestock is learned, its normal physiological parameter range, behavior pattern and change trend are learned, and a personalized health reference standard is formed; Evaluate model performance through cross-validation, calculate error rate, precision, and recall rate indicators, optimize model parameters and structure of the individualized health baseline model, and improve model generalization ability; An adaptive update mechanism for the individualized health baseline model is designed to regularly update the health baseline according to livestock growth and development stages and seasonal changes to ensure the timeliness and accuracy of the model.

6. The method according to claim 1, characterized in that The receiving of the livestock individualized feature vector and the livestock health baseline model library, comparing the deviation between the current state and the health baseline through an anomaly detection algorithm, identifying potential health problems, and outputting a health status assessment result, includes: receiving the livestock individualized feature vector, extracting key feature parameters, and providing input data for anomaly detection; Calling the individualized health baseline model of the corresponding livestock from the livestock health baseline model library, comparing the real-time features with the baseline model, and calculating the deviation and abnormality score of each dimension parameter; Use multiple anomaly detection algorithms for parallel analysis and combine the results of each algorithm through ensemble learning methods to improve the accuracy and robustness of anomaly detection; Based on the abnormality detection results, combined with expert knowledge rules, a risk assessment is performed on the current health status of the livestock to obtain the health status assessment result; wherein the health status assessment result includes four levels: normal, mild abnormality, moderate abnormality and severe abnormality; The health status assessment results are presented in a visual manner to generate a structured abnormality alert containing abnormal dimension, degree, location and time information.

7. The method according to claim 6, characterized in that The risk assessment of the current health status of the livestock is performed based on the abnormality detection result and combined with expert knowledge rules to obtain the health status assessment result, including: Using a combination of infrared thermal imaging and visible light imaging, the livestock body surface is divided into multiple key areas, and the normalized difference index of different key areas of the livestock body surface is calculated to form a livestock health thermal map that reflects the body surface temperature distribution pattern and blood circulation status; Integrating the normalized difference index, physiological parameter characteristics, behavioral characteristics, output indicators and historical health records to form a comprehensive feature vector through feature standardization and time series data alignment; Inputting the comprehensive feature vector into a fully connected neural network, which includes multiple hidden layers and an attention mechanism to automatically learn the importance weights of different features; Through the multi-task learning structure of the network, the evaluation results of four dimensions, namely health level classification, etiology type classification, system positioning classification and development trend classification, are simultaneously output; The SHAP method is used to calculate the contribution value of each feature to the classification result, and a contribution waterfall chart is generated to provide an interpretable basis for health status assessment.

8. The method according to claim 1, characterized in that The receiving of the health status assessment results, combined with the preset warning rules, provides graded warnings and generates intervention suggestions based on the severity of the abnormality, pushes warning information to the breeding staff through multiple channels, records the response measures and results, and forms a closed-loop management, including: Configure differentiated warning rules based on livestock species, age, and breeding objectives, including warning thresholds, warning levels, and response strategies; Based on the health risk assessment results and warning rules, hierarchical warning information including warning levels and configurations is generated, wherein a reminder-level warning is issued for mild anomalies, a warning-level warning is issued for moderate anomalies, and an emergency-level warning is issued for severe anomalies; Based on the graded warning information, early warning information is pushed to farmers through various channels such as application push, SMS and automatic phone notification to ensure that key warnings are delivered in a timely manner; Generate intervention recommendations for different types of health abnormalities, including key observation points, basic treatment methods, and timing of professional veterinary intervention, and record the actual intervention measures taken by farmers; Collect the intervention results and feedback from farmers after the warning, evaluate the accuracy and effectiveness of the warning, and continuously optimize the anomaly detection algorithm and warning rules.

9. The method according to claim 3, characterized in that The method of processing the pre-processed livestock image data using a deep learning model to achieve livestock target detection, individual identification, and behavior analysis includes: Collect multi-modal images including visible light images, infrared thermal images, depth images, and near-infrared images, perform spatial alignment and temporal synchronization to ensure that different modal images capture the same scene at the same moment, and obtain processed multi-modal image data; Based on the processed multi-modal image data, a four-dimensional input tensor containing multiple modalities is constructed, and feature extraction is performed using a three-dimensional convolutional neural network. Convolution operations are performed in the spatial dimension and the modal dimension to learn the association pattern between different modalities and obtain multi-modal features; Based on the multimodal features, a multi-scale three-dimensional feature extraction network is used, an encoder-decoder structure and a dilated three-dimensional convolution are adopted to expand the receptive field to capture a wider range of contextual information and output a multimodal feature map; Based on the multimodal feature map, a multi-scale self-attention mechanism is implemented to decompose the input feature map into feature representations at multiple scales, and a self-attention map is calculated for each scale to capture the dependencies between long-range features. Through the cross-attention modality fusion mechanism, the features of one modality guide the feature extraction process of another modality, enhancing the information exchange and mutual guidance between different modalities.

10. The method according to claim 1, characterized in that The method is applied to the health monitoring of livestock such as dairy cows, beef cattle, pigs or sheep. By collecting and analyzing biological data, environmental parameters and behavioral data in real time, potential health risks can be identified early to provide decision support for breeding management.

11. A real-time monitoring system for livestock health status based on the Internet of Things, characterized in that: include: A data acquisition and preprocessing module is used to collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and use edge computing devices to perform data cleaning, noise reduction, and preprocessing on the livestock biological data and environmental parameters to obtain a standardized multi-dimensional livestock data stream; an individual identification and feature fusion module for receiving the standardized multi-dimensional livestock data stream, combining it with livestock image data provided by the video surveillance system, identifying livestock individuals using a computer vision algorithm, analyzing behavioral characteristics and body shape changes, obtaining livestock visual data, and performing multi-source feature fusion on the biological data of the standardized multi-dimensional livestock data stream and the livestock visual data to generate livestock individual feature vectors; A health baseline model construction module is used to receive the livestock individualized feature vector, combine it with historical health records, construct an individualized health baseline model through a machine learning algorithm, and output a livestock health baseline model library; A health monitoring and anomaly detection module, configured to receive the livestock individualized feature vector and the livestock health baseline model library, compare the deviation between the current state and the health baseline using an anomaly detection algorithm, identify potential health problems, and output health status assessment results and anomaly alerts; The intelligent early warning and decision support module is used to receive the health status assessment results and the abnormal alarms, combine them with preset early warning rules, grade early warnings and generate intervention suggestions based on the severity of the abnormalities, push early warning information to farmers through multiple channels, record response measures and results, and form a closed-loop management.

12. The system according to claim 11, wherein: The system further comprises: Data storage module, used to store data such as livestock individual information, historical health records, biological data, environmental parameters and early warning records; System management module, used to manage user permissions, device status and system configuration; Communication interface module, used to realize data exchange between the system and external devices and services; User interaction module, used to provide a graphical interface to display livestock health status and early warning information; The data analysis module is used to conduct in-depth mining of historical data to discover potential health risk patterns.

Citation Information

Patent Citations

  • Method and system for monitoring abnormal behaviors of livestock raising

    CN116702051A

  • Intelligent livestock health monitoring system and detection method thereof

    CN117898688A

  • Poultry breeding monitoring management system based on big data

    CN119578884A

  • Deep forgery detection method based on self-mixing

    CN119672816A

  • Livestock disease prevention and control monitoring and early warning system based on Internet of Things

    CN119905255A

Cited By

  • Veterinary hybridization electronic recording method and system

    CN120833635A

  • Pepper breeding isolation shed control system based on Internet of Things

    CN120935230A

  • Livestock environment intelligent monitoring method and system based on Internet of Things

    CN121163598A

  • Laying hen health state monitoring method and system based on multi-modal image recognition

    CN121191197A

  • Construction site hidden danger identification method and system based on large model visual language model

    CN121258969A