Real-time monitoring method and system for livestock health status based on the Internet of Things
Patent Information
- Application Number
- CN202510605094.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2045-05-12
AI Technical Summary
这类系统能够提供基础的健康监测功能,但由于数据维度单一,监测算法简单,难以准确识别复杂的健康问题和行为异常
[0075]1.实现了多维度数据的实时采集与融合分析,通过生物传感、环境监测和计算机视觉技术的结合,全面捕捉牲畜的健康状态特征,提高了数据的完整性和准确性;
Smart Images

Figure CN120530898B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural Internet of Things (IoT) technology, and in particular to a method and system for real-time monitoring of livestock health status based on IoT, which is mainly applied to health monitoring and management in livestock farming such as dairy cows, beef cattle, pigs, or sheep. Background Technology
[0002] Livestock farming is an important part of agriculture. With the development of modern technology, intelligent farming management has become a key way to improve the efficiency and quality of livestock farming. Traditional livestock farming mainly relies on manual experience to observe the health status and behavioral characteristics of livestock. This method has problems such as strong subjectivity, discontinuous observation, and incomplete data recording.
[0003] Currently, most livestock farming management systems on the market focus on production management, ear tag identification, and basic record management. For example, some systems use RFID technology for livestock identification, obtaining basic information by scanning ear tags; others focus on feeding records and breeding management, achieving digital recording of the farming process.
[0004] The most advanced solutions in current technology involve installing sensors on livestock to collect single or limited physiological parameters, such as body temperature or activity level, and setting simple threshold alerts. These systems provide basic health monitoring, but due to their limited data dimensions and simple algorithms, they struggle to accurately identify complex health problems and behavioral abnormalities. Furthermore, data collection and analysis in existing systems are often fragmented, lacking consideration for individual livestock differences, resulting in low alert accuracy, high false alarm rates, and difficulty in timely detection of early, minor health abnormalities.
[0005] Furthermore, existing technologies have significant shortcomings in areas such as the continuity of 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 status. At the same time, the lack of intelligent data analysis and early warning mechanisms hinders farmers' ability to make scientific decisions and intervene in a timely manner, thus restricting the modernization of animal husbandry and the improvement of farming efficiency. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for real-time monitoring of 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, it can achieve accurate real-time monitoring of livestock health status, improve the accuracy and timeliness of abnormality detection, and provide scientific decision support 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] Livestock biological data and environmental parameters are collected by biochip ear tags and environmental sensors. The livestock biological data and environmental parameters are cleaned, denoised and preprocessed by edge computing devices to obtain a standardized multidimensional livestock data stream.
[0009] The system receives the standardized multidimensional livestock data stream, combines it with livestock image data provided by the video monitoring system, identifies individual livestock through computer vision algorithms and analyzes their behavioral characteristics and body shape changes to obtain livestock visual data. The system then performs multi-source feature fusion between the biological data from the standardized multidimensional livestock data stream and the livestock visual data to generate individualized livestock feature vectors.
[0010] Receive the individualized feature vector of the livestock, combine it with historical health records, construct an individualized health baseline model through machine learning algorithms, and output a livestock health baseline model library;
[0011] The system receives the individualized feature vector of the livestock and the livestock health baseline model library, compares the deviation between the current state and the health baseline using an anomaly detection algorithm, identifies potential health problems, and outputs a health status assessment result.
[0012] The system receives the health status assessment results, combines them with preset early warning rules, issues graded early warnings based on the severity of the abnormalities, generates intervention suggestions, pushes early warning information to farmers through multiple channels, records response measures and results, and forms a closed-loop management system.
[0013] Preferably, livestock biological data and environmental parameters are collected using biochip ear tags and environmental sensors. Edge computing devices are then used to clean, denoise, and preprocess the livestock biological data and environmental parameters to obtain a standardized multidimensional livestock data stream, including:
[0014] Biochip ear tags are installed on the ears of livestock to collect data on body temperature, heart rate and activity level. At the same time, environmental sensors are deployed in the pens to collect data on temperature, humidity and ammonia concentration, forming an Internet of Things 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 when the livestock is stationary, 3 minutes / time when the livestock is active, and 30 seconds / time when the livestock is in an abnormal state.
[0016] The edge computing device receives raw sensor data, performs data cleaning to remove outliers, performs wavelet transform filtering and time window moving average processing to reduce data transmission volume;
[0017] Z-score standardization is performed on sensor data from different sources and dimensions, and the data is aligned according to timestamps to solve the problem of asynchronous acquisition time of multi-source data;
[0018] The standardized data is transmitted using a low-power wide-area network, enabling hierarchical data caching and breakpoint resumption to ensure data integrity under unstable network conditions and output a standardized multidimensional livestock data stream.
[0019] Preferably, the step of receiving the standardized multidimensional livestock data stream, combining it with livestock image data provided by the video monitoring system, identifying individual livestock and analyzing behavioral characteristics and body shape changes through computer vision algorithms to obtain livestock visual data, and then fusing the biological data from the standardized multidimensional livestock data stream with the livestock visual data through multi-source feature fusion to generate individualized livestock feature vectors, includes:
[0020] Receive ear tag ID information from the standardized multidimensional livestock data stream, combine it with the livestock electronic record database, extract the basic information of the target livestock, and establish a unique mapping relationship between the ear tag ID information and the individual livestock;
[0021] The livestock image data is collected in real time by the camera system in the farm. The livestock image data is then preprocessed by denoising, illumination compensation and geometric correction to obtain preprocessed livestock image data.
[0022] The preprocessed livestock image data is processed using a deep learning model to achieve livestock target detection, individual recognition, and behavior analysis, and to extract livestock visual data based on body shape and behavioral characteristics.
[0023] Based on the biological data and visual data of the standardized multidimensional livestock data stream, time-domain features, frequency-domain features and statistical features are extracted 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 behavior features to generate an individualized feature vector that comprehensively reflects the health and behavioral status of livestock.
[0025] Preferably, the preprocessing of the livestock image data, including denoising, illumination compensation, and geometric correction, includes:
[0026] A multi-scale feature pyramid is constructed, with a low-level network capturing local features and a deep network capturing global features. Livestock image features containing both global and local features are extracted from the livestock image data.
[0027] The extracted livestock image features are mapped to the projection domain space, in which the image content and environmental artifact components are separated, so that the content information and artifacts can be distinguished in the projection space.
[0028] The interactive attention module uses global features to guide artifact recognition in local areas, and feeds back statistical information of the local features to guide global artifact pattern recognition, resulting in interactive image features.
[0029] Based on the image features after the interaction, the artifact distribution map in the original livestock image is estimated, and a corrected image is generated using residual learning, which preserves the original details while removing artifacts.
[0030] Based on the characteristics of images under different times and weather conditions, the enhancement parameters and correction intensity are adjusted to ensure clear livestock images are obtained in various environments.
[0031] Preferably, the step of receiving the individualized feature vector of the livestock, combining it with historical health records, constructing an individualized health baseline model through machine learning algorithms, and outputting a livestock health baseline model library includes:
[0032] Receive the individualized feature vector of the livestock, combine it with the historical health data in the breeding records, establish the historical health dataset of the individual livestock, and provide training data for the individualized health baseline model;
[0033] The study analyzes the influence of livestock physiological cycles and environmental factors on biological parameters, establishes a background model of parameter fluctuations, and improves the environmental adaptability of the individualized health baseline model.
[0034] Based on the time-series model, an individualized health baseline model is created for each animal, learning its normal physiological parameter range, behavioral patterns and trends of change, and forming a personalized health reference standard.
[0035] The model performance was evaluated using cross-validation, and the error rate, precision, and recall metrics were calculated. The model parameters and structure of the individualized health baseline model were optimized to improve the model's generalization ability.
[0036] The individualized health baseline model is designed with an adaptive update mechanism to regularly update the health baseline based on the livestock's growth and development stage and seasonal changes, ensuring the model's timeliness and accuracy.
[0037] Preferably, the step of receiving the individualized feature vector of the livestock and the livestock health baseline model library, comparing the 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] Receive the individualized feature vector of the livestock, extract key feature parameters, and provide input data for anomaly detection;
[0039] The individualized health baseline model of the corresponding livestock is called from the livestock health baseline model library, the real-time features are compared with the baseline model, and the deviation and anomaly score of each dimension parameter are calculated.
[0040] Multiple anomaly detection algorithms are analyzed in parallel, and the results of each algorithm are combined through ensemble learning to improve the accuracy and robustness of anomaly detection;
[0041] Based on the anomaly detection results and combined with expert knowledge rules, a risk assessment is conducted on the current health status of the livestock to obtain the health status assessment results; wherein, the health status assessment results include four levels: normal, mildly abnormal, moderately abnormal, and severely abnormal.
[0042] The health status assessment results are presented in a visual manner, generating structured anomaly alerts that include information on the dimensions, degree, location, and time of the anomalies.
[0043] Preferably, the step of conducting a risk assessment of the livestock's current health status based on the anomaly detection results and in conjunction with expert knowledge rules to obtain the health status assessment result includes:
[0044] By combining infrared thermal imaging and visible light imaging, multiple key regions are divided on the surface of livestock. The normalized difference index of different key regions on the surface of livestock is calculated to form a livestock health thermal map, which reflects the surface temperature distribution pattern and blood circulation status.
[0045] By integrating the normalized difference index, physiological parameter features, behavioral features, output indicators, and historical health records, a comprehensive feature vector is formed through feature standardization and time-series data alignment.
[0046] 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.
[0047] Through the multi-task learning structure of the network, evaluation results in four dimensions are simultaneously output: health status classification, etiology type classification, system location classification, and development trend classification.
[0048] The SHAP method is used to calculate the contribution value of each feature to the classification result, generating a contribution waterfall plot to provide interpretable evidence for health status assessment.
[0049] Preferably, the process of receiving the health status assessment results, combining them with preset early warning rules, issuing graded early warnings and generating intervention suggestions based on the severity of the abnormalities, pushing early warning information to farmers through multiple channels, recording response measures and results, and forming a closed-loop management system includes:
[0050] Configure differentiated early warning rules based on livestock breed, age, and breeding objectives, including early warning thresholds, early warning levels, and response strategies;
[0051] Based on the health risk assessment results and early warning rules, a tiered early warning information system is generated, which includes early warning levels and configurations. Mild abnormalities trigger a reminder-level early warning, moderate abnormalities trigger a warning-level early warning, and severe abnormalities trigger an emergency-level early warning.
[0052] Based on the aforementioned tiered early warning information, early warning information is pushed to aquaculture personnel through multiple channels such as application push, SMS and automatic telephone notification to ensure that key early 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 the timing of professional veterinary intervention, and record the actual intervention measures taken by the farmers;
[0054] Collect the intervention results and feedback from aquaculture personnel after the early warning, evaluate the accuracy and effectiveness of the early warning, and continuously optimize the anomaly detection algorithm and early warning rules.
[0055] Preferably, the step of using a deep learning model to process the preprocessed livestock image data to achieve livestock target detection, individual identification, and behavior analysis includes:
[0056] Multiple modal images, including visible light images, infrared thermal images, depth images, and near-infrared images, are acquired, and spatial alignment and temporal synchronization are performed to ensure that different modal images capture the same scene at the same time, resulting in processed multi-modal image data.
[0057] Based on the processed multimodal image data, a four-dimensional input tensor containing multiple modalities is constructed. Feature extraction is performed through a three-dimensional convolutional neural network. Convolution operations are performed in the spatial and modal dimensions to learn the correlation patterns between different modalities and obtain multimodal features.
[0058] Based on the aforementioned multimodal features, a multi-scale three-dimensional feature extraction network is used, employing an encoder-decoder structure and dilated three-dimensional convolution to expand the receptive field, 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, which decomposes the input feature map into feature representations of multiple scales, calculates a self-attention map for each scale, and captures the dependencies between distant features.
[0060] By using the cross-attention modality fusion mechanism, the features of one modality guide the feature extraction process of another modality, thereby enhancing 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 at an early stage, providing decision support for livestock management.
[0062] This invention also provides an Internet of Things-based real-time monitoring system for livestock health status, comprising:
[0063] The data acquisition and preprocessing module is used to collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and to use edge computing devices to clean, denoise and preprocess the livestock biological data and environmental parameters to obtain a standardized multidimensional livestock data stream.
[0064] The individual identification and feature fusion module is used to receive the standardized multidimensional livestock data stream, combine it with the livestock image data provided by the video monitoring system, identify individual livestock through computer vision algorithms and analyze behavioral characteristics and body shape changes to obtain livestock visual data, and perform multi-source feature fusion of the biological data of the standardized multidimensional livestock data stream and the livestock visual data to generate individualized livestock feature vectors.
[0065] The health baseline model construction module is used to receive the individualized feature vectors of the livestock, combine them with historical health records, construct an individualized health baseline model through machine learning algorithms, and output a livestock health baseline model library.
[0066] The health monitoring and anomaly detection module is used to receive the individualized feature vector of the livestock and the livestock health baseline model library, compare the deviation between the current state and the health baseline through anomaly detection algorithm, identify potential health problems, and output health status assessment results and anomaly alarms.
[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, issue graded early warnings and generate intervention suggestions according to the severity of the abnormality, push early warning information to farmers through multiple channels, record response measures and results, and form a closed-loop management system.
[0068] Preferably, the system further includes:
[0069] The data storage module is used to store data such as individual livestock information, historical health records, biological data, environmental parameters, and early warning records;
[0070] The system management module is used to manage user permissions, device status, and system configuration.
[0071] The communication interface module is used to enable data exchange between the system and external devices and services;
[0072] The user interaction module provides a graphical interface to display livestock health status and early warning information.
[0073] The data analysis module is used to deeply mine historical data and discover potential health risk patterns.
[0074] The present invention has the following beneficial effects:
[0075] 1. Real-time acquisition and fusion analysis of multi-dimensional data were achieved. By combining biosensing, environmental monitoring and computer vision technologies, the health status characteristics of livestock were comprehensively captured, improving the integrity and accuracy of the data.
[0076] 2. An individualized health baseline model was established, taking into account individual differences in livestock, physiological cycles, and the influence of environmental factors, making health status assessment more accurate and reducing the false alarm rate;
[0077] 3. Employing advanced multimodal data processing and anomaly detection algorithms, it can identify early and minor health abnormalities, 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, the early warning rules and detection algorithms are continuously optimized, and the system performance continues to improve over time.
[0079] 5. It provides visualized and interpretable health assessment results to help farmers understand the causes of early warnings, guide scientific decision-making, and improve farming efficiency and profitability;
[0080] 6. This invention solves the problems of discontinuous, inaccurate, and untimely health monitoring in traditional animal husbandry by integrating the Internet of Things, artificial intelligence, and big data technologies, and provides technical support for the digital and intelligent transformation of animal husbandry. Attached Figure Description
[0081] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0082] Figure 1 This is a flowchart of the method for real-time monitoring of livestock health status based on the Internet of Things according to the present invention.
[0083] Figure 2 This is a detailed flowchart of the livestock data collection and preprocessing steps of the present invention;
[0084] Figure 3This is a detailed flowchart of the livestock individual identification and multi-dimensional feature fusion steps of the present invention;
[0085] Figure 4 This is a detailed flowchart of the steps for constructing the livestock health baseline model of the present invention;
[0086] Figure 5 This is a detailed flowchart of the real-time health monitoring and anomaly detection steps of the present invention;
[0087] Figure 6 This is a detailed flowchart 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, according to the present invention. Detailed Implementation
[0089] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, but the implementation of the present invention is 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: Collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and use edge computing devices to clean, denoise and preprocess the livestock biological data and environmental parameters to obtain a standardized multidimensional livestock data stream.
[0092] This step begins by constructing a comprehensive Internet of Things (IoT) sensing network on the farm. Biochip ear tags, integrating various miniature sensors, are installed on the livestock's ears to collect biological parameters such as body temperature, heart rate, and activity level. Simultaneously, environmental sensor arrays are installed at key locations within the livestock pens to measure environmental indicators such as temperature, humidity, and ammonia concentration, thereby understanding the livestock's environmental conditions. To improve system energy efficiency, an intelligent frequency adjustment strategy is employed, dynamically adjusting the data acquisition frequency based on the livestock's behavior and system load. Specifically, when the livestock are stationary, the acquisition frequency is set to once every 15 minutes to save energy; when activity is detected, it increases to once every 3 minutes to capture more dynamic information; and when the system initially determines that the livestock may be experiencing abnormalities, it further increases to once every 30 seconds to ensure timely monitoring of potential health problems.
[0093] Raw data collected by sensors often contains noise, outliers, and redundant information. Direct transmission would waste network resources; therefore, this step involves real-time preprocessing on an edge computing device. The specific processing flow includes: first, identifying and removing obvious outliers using statistical thresholding; then, applying wavelet transform filtering to eliminate high-frequency noise; next, compressing the data volume using a time window moving average algorithm to reduce transmission burden; and finally, performing Z-score standardization on data from different sources and at different scales to make various parameters comparable and analyzable. The processed data is aligned by timestamps to address the asynchronous nature of multi-source data acquisition, forming a structured multidimensional time-series data stream. To ensure data transmission reliability, the system employs low-power wide-area network technologies (such as NB-IoT or LoRa) and implements hierarchical data caching and breakpoint resumption mechanisms, ensuring data integrity even in unstable network environments. Finally, the preprocessed, standardized multidimensional data stream is securely transmitted to the central server.
[0094] Step S2: Receive the standardized multidimensional livestock data stream, combine it with the livestock image data provided by the video monitoring system, identify individual livestock through computer vision algorithms and analyze behavioral characteristics and body shape changes to obtain livestock visual data, and fuse the biological data of the standardized multidimensional livestock data stream with the livestock visual data through multi-source feature fusion to generate individualized livestock feature vectors.
[0095] This step first uses electronic identification technology to extract ear tag ID information from a standardized biological data stream and matches it with individual information (including breed, age, sex, reproductive status, etc.) in the livestock electronic record database. This establishes a unique mapping between the data and the individual livestock, ensuring that subsequent analysis is targeted at specific individuals. Simultaneously, a high-definition camera network within the farm is used to capture real-time video images of the livestock from multiple angles. These raw images are often affected by uneven lighting, dust, and moisture in the farming environment, requiring preprocessing to improve the accuracy of subsequent identification. 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 aquaculture environments, a ring artifact correction technique based on global-local feature interaction in the projection domain is adopted. This technique first constructs a multi-scale feature pyramid to extract global features (overall illumination distribution, tone balance, etc.) and local features (details of key parts such as livestock outlines and ear tag areas) from the image. Then, these features are mapped to a specific projection domain, making it easier to separate image content from environmental artifacts in this space. Next, through an interactive attention module, global features guide artifact recognition in local areas, while local features also guide global artifact pattern recognition. Based on this bidirectional interaction, the system can accurately estimate the artifact distribution in the original image and generate a corrected image using residual learning, removing artifacts while preserving effective image information. Finally, the enhancement parameters are dynamically adjusted according to the current environmental conditions (day / night, 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 identification, and behavior analysis. This process includes locating each animal in the image, identifying its identity, and analyzing its posture and behavior. The extracted visual features mainly include two categories: body shape features (morphological indicators such as body length, height, width, and body condition score) and behavioral features (identification results of actions such as walking, lying down, feeding, and rumination, as well as statistical quantities such as duration and frequency). To improve the accuracy and robustness of recognition, the system adopts 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-distance 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 including time domain (mean, variance, peak value, trend, etc.), frequency domain (power spectral density, dominant frequency, frequency band energy distribution, etc.), and statistical features (entropy, skewness, kurtosis, quantiles, etc.) to form a multidimensional feature set describing livestock status. Finally, a multimodal fusion algorithm integrates features from different sources. The system employs an attention-based feature fusion network that adaptively learns the importance weights of different features in different contexts, organically combining biosensor data features with visual behavioral features to generate personalized feature vectors that comprehensively reflect livestock health status and behavioral characteristics, providing a foundation for subsequent health baseline model construction and anomaly detection.
[0099] Step S3: Receive the individualized feature vector of the livestock, combine it with historical health records, construct an individualized health baseline model through machine learning algorithms, 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, past medical history, treatment records, milk production or weight gain data, and other production performance indicators), to establish a comprehensive historical health dataset for individual livestock. These datasets are organized by time series, containing both long-term trends and short-term fluctuation patterns, 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 data to ensure data quality. Next, the system analyzes the influence of livestock physiological cycles and environmental factors on biological parameters. Livestock physiological parameters exhibit regular changes with physiological cycles (such as estrus, pregnancy, and lactation) and environmental factors (such as seasonal changes, temperature fluctuations, and day-night cycles). While these changes are not necessarily health abnormalities, they can affect monitoring and judgment. Through time series decomposition and periodic analysis, the system identifies and models these regular fluctuations, forming a background model of parameter fluctuations and improving the baseline model's adaptability to normal physiological changes and environmental responses.
[0101] Based on prepared data and background models, the system employs machine learning algorithms to train an individualized health baseline model for each animal. Specifically, the system uses deep temporal models (such as LSTM, GRU, and other recurrent neural networks) to capture the temporal dependencies of livestock physiological parameters and behavioral patterns. These models can learn the normal physiological parameter ranges, daily behavioral patterns, and trends of these indicators over time, forming a personalized health reference standard for each animal. The model pays particular attention to the correlations and co-variation patterns between parameters, as certain health problems can lead to co-variation anomalies in multiple indicators, rather than deviations in a single indicator. To ensure model quality, the system uses cross-validation to evaluate the model, calculating multiple metrics such as error rate, precision, recall, and F1 score, and optimizes the model parameters and structure based on these evaluation results. The optimization process employs methods such as Bayesian optimization or grid search to systematically explore optimal parameter combinations, improving the model's generalization ability and stability under different conditions.
[0102] Considering the growth and development of livestock and seasonal environmental changes, static baseline models are prone to becoming inaccurate over time. Therefore, the system is designed with an adaptive update mechanism for the baseline model. This mechanism triggers model updates periodically or when significant physiological changes are detected, based on factors such as the livestock's growth stage (e.g., juvenile, adult, and old age) and seasonal variations. The update process employs an incremental learning method, integrating newly collected data for fine-tuning while retaining the model's original knowledge, thus avoiding 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. Finally, 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: Receive the individualized feature vector of the livestock 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 the 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 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 duration, lying down frequency, movement patterns, etc.), which together constitute a multidimensional representation of the livestock's current health status. The system then calls the individualized baseline model corresponding to the current livestock from the health baseline model library constructed in step S3, and performs a multidimensional comparison between the real-time features and this baseline model. 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 changes in the correlation between parameters, generating 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 applicable scenarios and advantages. By integrating the results of various algorithms through ensemble learning methods (such as weighted voting or stacked ensemble), the system can more comprehensively capture different types of anomaly patterns and reduce false positives and false negatives.
[0105] Based on anomaly detection results and combined with veterinary expert knowledge rules, the system performs risk assessment and classification of livestock's current health status. In this process, the system utilizes a precise health status classification technology based on NDVI (Normalized Difference Vegetation Index) and a fully connected neural network. This technology innovatively applies the NDVI concept to livestock health monitoring. By combining infrared thermal imaging and visible light imaging, it calculates the normalized difference index for different key areas of the livestock's body surface (such as the head, neck, chest, abdomen, and limbs), forming a livestock health heat map similar to a "healthy vegetation map," effectively reflecting the body surface temperature distribution pattern, blood circulation status, 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. These feature vectors, after standardization and temporal alignment, are input into a specially designed fully connected neural network for health status classification. This network incorporates multiple hidden layers and an attention mechanism, enabling it to automatically learn the importance weights of different features in various health problems. 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 type classification (infectious, metabolic, traumatic, stress-related, etc.), system location classification (respiratory, digestive, reproductive, musculoskeletal, etc.), and development trend classification (stable, improving, deteriorating, and fluctuating). To enhance the interpretability of the assessment results, the system employs the SHAP (SHapley Additive ex Planations) method to calculate the contribution of each feature to the classification result, generating an intuitive contribution waterfall plot to help farmers understand the key factors leading to the current classification outcome.
[0106] The health status assessment results are presented visually, including health status dashboards, multi-dimensional parameter trend charts, and highlighted abnormal indicators, enabling farmers to intuitively grasp the health status of livestock. Simultaneously, structured abnormal alerts are generated based on the assessment results, containing detailed information such as the abnormal dimension (which indicators are abnormal), the degree of abnormality (how much it deviates from the normal range), the location of the abnormality (which part or system of the livestock's body), and the time of the abnormality (when it started and how long it lasted). These health status assessment results and abnormal alerts will serve as input for subsequent intelligent early warning and decision support steps.
[0107] Step S5: Receive the health status assessment results, combine them with preset early warning rules, issue graded early warnings and generate intervention suggestions according to the severity of the abnormality, push early warning information to farmers through multiple channels, record the response measures and results, and form a closed-loop management system.
[0108] This step begins with the 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), age stage (e.g., juvenile, adult, old), and breeding goals (e.g., milk production, fattening, reproduction). These rules include early warning trigger threshold settings (e.g., how many degrees of increase in body temperature, what percentage decrease in activity level), early warning level classification standards, and corresponding response strategies. Early warning rules support user customization and system self-learning optimization; as the system accumulates more experience, the early warning rules will gradually adjust to improve accuracy. Based on the health status assessment results from step S4 and the preset early warning rules, tiered early warning information is generated. Early warnings are divided into three main levels: for mild abnormalities, the system issues a "reminder" warning, suggesting increased observation frequency; for moderate abnormalities, a "warning" warning, suggesting preventative measures; and for severe abnormalities, an "emergency" warning, suggesting immediate intervention. Each early warning message includes the type of abnormality, possible health problem diagnosis, severity assessment, and preliminary treatment suggestions, providing decision-making references for livestock farmers.
[0109] Based on the warning level and configuration, warning information is pushed to relevant farmers through multiple channels. For alert-level warnings, a notification may only be displayed in the management system app; for warning-level warnings, in addition to the app notification, an SMS will be sent to the responsible person; and for emergency-level warnings, the app push, SMS notification, and automated voice reminder will be triggered simultaneously to ensure that critical warnings are delivered to relevant personnel in a timely manner, improving response efficiency. Targeted intervention suggestions are generated for different types of health abnormalities, including key observation points (symptoms and indicators requiring special attention), basic treatment methods (such as adjusting feed, isolation observation, basic drug treatment, etc.), and the timing of professional veterinary intervention (when to seek professional veterinary assistance). These suggestions are based on a veterinary expert knowledge base and historical case analysis, making them highly practical and targeted. An intervention implementation record function is also provided, allowing farmers to record the actual measures taken, medication use, observation results, and other information to form a complete abnormality handling file.
[0110] To continuously improve system performance, the system collects intervention results and feedback from farmers after each warning, including information on the accuracy of the warning (whether a health problem actually exists), the effectiveness of the intervention, and the appropriateness of the warning timing (whether it was timely enough). Based on this feedback, the accuracy and effectiveness of the warnings 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 identified as a false alarm, the system will automatically adjust the relevant thresholds or algorithm parameters; if a certain intervention is effective for a specific anomaly, the system will increase the recommendation priority of that intervention in similar situations in the future. This closed-loop management mechanism enables the system to continuously learn and improve from practical applications, thereby enhancing the accuracy and practicality of warnings and providing increasingly precise 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 and other sensors) and positioning base stations in the pens to form an Internet of Things sensing network covering the entire farm area, so as to realize the comprehensive collection of livestock biological data and environmental data.
[0113] Step S1.2, Dynamic adjustment of data acquisition frequency: Based on the livestock activity status and system load, dynamically adjust the data acquisition frequency, such as 15 minutes / time in a static state, 3 minutes / time in an active state, and up 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: Utilize the edge computing equipment in the farm to receive raw sensor data, perform data cleaning (removing obvious outliers), noise filtering (wavelet transform filtering), and data compression (time window moving average) to reduce data transmission volume and storage pressure.
[0115] Step S1.4, Data Standardization and Time Sequence Alignment: Standardize sensor data from different sources and dimensions (Z-score standardization) and align them according to timestamps to solve the problem of asynchronous acquisition time of multi-source data and form a multi-dimensional time-series data stream in a standard format.
[0116] Step S1.5, Transmission Quality Assurance: Low-power wide-area networks (NB-IoT, LoRa, etc.) are used to transmit data, and data hierarchical caching and breakpoint resumption are implemented to ensure the integrity and reliability of data under unstable network conditions, and finally output a standardized multi-dimensional livestock biological data stream.
[0117] like Figure 3As shown, step S2, livestock individual identification and multidimensional feature fusion, specifically includes:
[0118] Step S2.1, Livestock Electronic Identification: Receive the ear tag ID information from the standardized biological data stream output in step S1, combine it with the livestock electronic record database, extract the basic information of the target livestock (breed, age, sex, etc.), and establish a unique mapping relationship between the data and the individual livestock.
[0119] Step S2.2, Video Image Acquisition and Preprocessing: Real-time video images of livestock are acquired through the camera system in the farm, and the images are preprocessed (noise reduction, illumination compensation, geometric correction, etc.) to improve the accuracy of subsequent recognition.
[0120] In step S2.2, the specific implementation of denoising, illumination compensation, and geometric correction preprocessing of the livestock image data is as follows, including:
[0121] S2.2.1 Multi-scale feature extraction: Construct a multi-scale feature pyramid, with a low-level network capturing local features such as texture and a deep network capturing global features such as semantics, and extract livestock image features containing both global and local features from the livestock image data.
[0122] Multi-scale feature extraction is the first crucial step in ring artifact correction. This process employs a deep convolutional neural network architecture, using an improved ResNet or EfficientNet as the backbone network, to extract feature information at different levels and scales from the input livestock image. In the shallow layers of the network, the focus is primarily on local texture features, such as the texture details of the livestock's fur, the edge contours of the ear tag area, and subtle features of various body parts. These local features are crucial for accurately identifying individual livestock characteristics and detecting minor anomalies. In the deeper layers, global features such as overall illumination distribution, large-scale tone balance, and scene semantics are captured, helping to understand the environmental conditions of the entire image and the distribution patterns of large-scale artifacts. The system integrates these features at different levels through a Feature Pyramid Network (FPN) to construct a complete multi-scale feature representation. This pyramid structure typically includes five scale levels, with the resolution gradually decreasing from 1 / 4 to 1 / 64 of the original image, enabling the system to simultaneously focus on the microscopic details and macroscopic structure of the livestock image, providing a comprehensive, multi-scale feature foundation for subsequent artifact recognition and correction. In livestock farming environments, this multi-scale feature extraction is particularly effective because it can simultaneously address complex artifact problems such as large-scale uneven lighting and localized fence shadows, dust reflections, etc.
[0123] S2.2.2 Projection Domain Transformation: The extracted livestock image features are mapped to a specially designed projection domain space (such as frequency domain, wavelet domain, etc.). In this space, the image content and environmental artifact components are separated, making the content information and artifacts easier to distinguish in the projection space.
[0124] Traditional image processing methods typically operate directly in the spatial domain, making it difficult to effectively separate the animal content from environmental artifacts. This step innovatively introduces projection domain transformation technology, mapping extracted image features to a specially designed projection space to achieve effective separation of content and artifacts. This transformation process relies on a set of learnable projection matrices, which are automatically optimized through network training, resulting in a more distinct feature distribution between animal content and environmental artifacts in the projection space. Specifically, a projection transformation module containing multiple learnable linear transformation layers and nonlinear activation functions is designed. For frequency domain projection, 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 animal content typically manifests as mid-to-low frequency signals, while environmental artifacts such as strong light reflection and water vapor blurring are mainly distributed in specific frequency bands. Furthermore, the system implements a multi-channel projection mechanism, simultaneously projecting image features into multiple different feature spaces (such as the frequency domain, gradient domain, and color space). Artifacts are processed in parallel across multiple projection domains, and the processing results from each domain are ultimately fused to improve the comprehensiveness of the correction effect. This projection domain conversion technology is particularly suitable for handling complex lighting conditions commonly found in livestock farms, such as large differences in light levels inside and outside the pens, and light spots formed by sunlight penetrating the fences. It can effectively identify and separate various types of environmental artifacts while preserving the details of the livestock's appearance.
[0125] S2.2.3 Global-Local Feature Interaction: The interactive attention module enables global features (such as overall illumination) to guide artifact recognition in local areas (such as animal body parts), while the statistical information of the local features is used to guide global artifact pattern recognition, thereby enhancing the ability to perceive 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 suffer from detail loss. To accurately identify these regionally differentiated artifacts, an innovative global-local feature interaction mechanism was designed to achieve bidirectional information flow and mutual guidance at the feature level. In this mechanism, a self-attention module first processes global features to capture the illumination distribution pattern and main artifact types of the entire image. Then, a cross-attention module uses these global features as "queries" to interact with local feature maps, generating attention weight maps to guide the precise location and identification of local artifacts. For example, when global features indicate that the overall illumination is too strong, the interaction module will focus more on areas in the local region that may be overexposed, improving the artifact correction accuracy in these areas. Simultaneously, a reverse guidance mechanism was designed to feed back statistical information from local features (such as region histograms and local gradient distributions) to the global feature processing module, helping it to more accurately understand the overall artifact characteristics of the current 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 boundary between sunlight and shadow, or the problem of inconsistent lighting between different pens, ensuring consistent high image quality under various complex conditions.
[0127] S2.2.4 Artifact Estimation and Image Reconstruction: Based on the image features after the interaction, the artifact distribution map in the original livestock image is estimated, and a corrected image is generated using residual learning to preserve the original details while removing or reducing the influence of artifacts.
[0128] After feature extraction and interactive analysis, the system proceeds to the artifact estimation and image reconstruction stage. First, a precise artifact distribution map is generated based on the interactive features through a decoder network. This map, presented as a heatmap, identifies the location, intensity, and type of various environmental artifacts in the original image. This visualization provides clear guidance for accurate 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 part that needs correction). This residual is then added to the original image to obtain the final corrected result. This method effectively avoids overcorrection and loss of detail, ensuring that only artifact areas are corrected while preserving the original information of other areas. Crucially, it preserves key animal identification features such as ear tags and body texture. The reconstruction process is implemented using a conditional generative adversarial network (cGAN) framework. The generator is responsible for generating high-quality corrected images, while the discriminator evaluates the realism and consistency of the generated images, continuously improving the generation quality through adversarial training. To comprehensively ensure the quality of the generated images, a combination of various loss functions is introduced, including pixel-level L1 loss (ensuring basic content consistency), structural similarity loss (SSIM) (preserving important structural information), perceptual loss (maintaining high-level semantic features), and adversarial loss (enhancing 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: Based on the characteristics of images at different times (day / night) and under different weather conditions, the enhancement parameters and correction intensity are dynamically adjusted to ensure the best image quality in various environments.
[0130] The lighting conditions in livestock farming environments vary significantly with time and weather. To address this, the system employs an adaptive enhancement strategy, dynamically adjusting correction parameters and enhancement intensity based on current environmental conditions. This strategy is based on two core components: an environmental feature classifier and a parameter adjustment network. The environmental feature classifier automatically identifies the current scene's environmental type by analyzing global image features, including categories such as sunny daytime, cloudy daytime, sufficient nighttime lighting, and insufficient nighttime lighting. The classification results serve as input, guiding the parameter adjustment network to select the optimal combination of processing parameters for the current environment. The parameter adjustment network uses a meta-learning method to automatically generate a set of optimal processing parameters based on the environment type, including contrast enhancement coefficients, detail enhancement intensity, and shadow compensation levels. These parameters directly control the behavior of each module during reconstruction, ensuring optimal image quality under different environments. For example, in bright daylight, the system may prioritize detail preservation and vignetting removal; while in low-light nighttime conditions, it may focus more on brightening shadow areas and enhancing contrast. Furthermore, the system implements an incremental learning mechanism, continuously collecting environmental samples and correction effect feedback from daily operation to continuously update and optimize the environmental classifier and parameter adjustment network. This self-learning capability enables the system to become increasingly adaptable to the environmental characteristics of specific livestock farms, and the correction effect continues to improve. During long-term operation, the system can automatically adjust to the optimal processing parameters for each camera location, each time period, and each weather condition, ensuring stable and clear livestock images under any 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, Faster R-CNN, etc.) to process the preprocessed images to achieve livestock target detection, individual recognition and behavior analysis, and extract visual data including body shape features (body length, body height, body width, etc.) and behavioral features (walking, lying down, feeding, etc.).
[0132] In step S2.3, the preprocessed livestock image data is processed using a deep learning model to achieve livestock target detection, individual identification, and behavior analysis. The specific implementation includes:
[0133] Step S2.3.1 Multimodal Image Acquisition and Preprocessing: Acquire multiple 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 time, and obtain processed multimodal image data.
[0134] Multimodal image segmentation relies on acquiring data from multiple imaging modalities. In livestock farming environments, various complementary imaging devices are deployed to comprehensively collect visual information about livestock. Visible light cameras capture conventional visual features such as appearance, color, and surface texture, providing the most basic imaging modality and rich detail and appearance information. Infrared thermal imaging devices record the surface temperature distribution of livestock, operating without external light sources and providing clear animal outlines even at night or in low-light conditions. Thermal imaging is particularly suitable for identifying closely clustered individuals because temperature boundaries typically exist between different individuals, aiding in segmenting overlapping animals. Depth cameras acquire 3D information about the scene using structured light or Time-of-Flight (ToF) technology, intuitively reflecting the animal's body shape and spatial relationships, and are especially effective for handling partial occlusion and accurately estimating animal size. Near-infrared cameras can penetrate light dust and moisture, providing clearer outline information in low-visibility farming environments, while also revealing features not readily apparent in visible light, such as vein distribution. These multimodal images undergo a series of meticulous preprocessing steps after acquisition to ensure effective fusion. First, spatial alignment is performed by aligning images from different cameras to the same coordinate system through camera calibration and geometric transformation. Next, temporal synchronization is performed to ensure that different modalities capture the same scene at the same instant, avoiding inconsistencies caused by livestock movement. Then, noise reduction is applied 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, which serves as input for subsequent deep feature extraction.
[0135] Step S2.3.2 3D Feature Extraction: Based on the processed multimodal image data, a four-dimensional input tensor (batch × modality × height × width) containing multiple modalities is constructed. Feature extraction is performed through a three-dimensional convolutional neural network. Convolution operations are performed in the spatial dimension and modal dimension to learn the correlation patterns between different modalities and obtain multimodal features.
[0136] Traditional 2D convolutional networks treat different modalities as independent channels, making it difficult to fully capture complementary information between modalities. This step innovatively employs a 3D convolutional neural network architecture, organizing images of different modalities into a 4D input tensor to achieve true multimodal joint feature extraction. Specifically, a 4D input tensor with the shape (batch size × number of modalities × image height × image width) is first constructed, where the modal dimension includes different types of data such as visible light, thermal imaging, depth images, and near-infrared images. This data organization preserves the relationships between modalities, enabling the network to learn cross-modal feature patterns. Subsequently, this tensor is processed through 3D convolutional layers. The key difference between 3D convolution and traditional 2D convolution is that its convolution kernel slides simultaneously in both the spatial dimensions (height and width) and the modal dimensions, performing three-dimensional convolution operations. This allows the network to automatically learn the 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 between contours in depth maps and near-infrared images. The network adopts 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, downsampling layer by layer to reduce the feature map size, 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 utilize the advantages 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, employing an encoder-decoder structure and dilated three-dimensional convolution to expand the receptive field, 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 structure. The encoder part contains multiple downsampling modules, each consisting of 3D convolution, batch normalization, ReLU activation, and max pooling, progressively reducing the spatial resolution of the feature maps (typically to 1 / 16 or 1 / 32 of the original size) while increasing the number of channels (from the initial 64 channels to 512 or 1024 channels) to capture hierarchical features from local details to global semantics. This design enables the network to simultaneously understand the microscopic features of livestock (such as texture of specific parts) and macroscopic structures (such as overall contours and body posture). At key levels of the encoder, the system introduces dilated 3D convolution. This special convolutional operation expands the receptive field without increasing the number of parameters or computational burden by inserting "holes" between the convolutional kernel elements. For example, a 3×3×3 convolutional kernel with a dilation rate of 2 effectively has a 5×5×5 receptive field, allowing the network to acquire broader contextual information while maintaining resolution. The decoder section progressively restores the spatial resolution of the feature maps through transposed 3D convolutions (sometimes called deconvolutions) and fuses features from different encoder layers using skip connections to preserve detailed information. This design effectively addresses the information loss problem in deep networks, ensuring that the final segmentation result includes both accurate boundary localization and rich semantic understanding. Furthermore, the system implements a Feature Pyramid Pooling module, performing multi-scale pooling (such as global pooling, 1 / 2 pooling, 1 / 4 pooling, etc.) on the feature maps. The pooling results are then upsampled and concatenated to form feature representations containing receptive field information at different scales. This multi-scale feature representation enables the system to effectively handle complex scenarios in farms, such as variations in livestock size (near and far distances), partial occlusion, and group aggregation, significantly improving the adaptability and robustness of the 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, which decomposes the input feature map into feature representations of multiple scales, calculates the self-attention map for each scale, and captures the dependencies between distant features.
[0140] In multimodal image segmentation, complex interdependencies exist between features at different locations and scales. Traditional convolutional operations, limited by local receptive fields, struggle to effectively model these long-distance relationships. To address this issue, an innovative multi-scale self-attention mechanism is designed, adaptively focusing on relevant features while suppressing irrelevant information. Specifically, the system first decomposes the input multimodal feature map into feature representations at multiple scales, independently calculating self-attention for each scale. Taking a single scale as an example, the system generates query, key, and value feature maps through three independent 1×1×1 convolutional layers, with dimensions typically ranging from 1 / 8 to 1 / 4 of the original feature channels. Then, the dot product similarity matrix between the query and key features is calculated, reflecting the correlation at different locations on the feature map. This matrix is normalized using a softmax function to obtain attention weights. Finally, these weights are applied to the value feature map for weighted summation, generating the attention feature output for the current scale. Unlike standard self-attention, this system's multi-scale self-attention has three innovative aspects: First, it operates in a 3D feature space, considering the correlation between spatial location and modal dimensions, enabling the establishment of intra-modal and inter-modal attention mechanisms. Second, it independently computes attention for each scale and then integrates the multi-scale attention results through a feature fusion network, better handling differences in livestock body size. Finally, it introduces positional encoding, encoding the spatial location information of the feature map into the query and key, enhancing the model's perception of spatial structure. This mechanism allows the system to capture dependencies between distant features; for example, features of a cow's head may be correlated with features of its legs. This correlation helps in accurately identifying the complete livestock outline, especially in identifying individual boundaries in a group environment. Through attention computation in the modal dimension, the system can also dynamically adjust the importance of different modalities, strengthening the most informative modal features according to specific scene conditions. For example, it may rely more on visible light features under bright conditions, while at night it may emphasize thermal imaging features.
[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 region 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 different modalities require more refined modeling. Cross-attention modal fusion mechanisms are specifically designed to enhance information exchange and mutual guidance between different modalities, significantly improving the discriminative power of fused features. The core idea is to allow features from one modality to guide the feature extraction process of another, achieving bidirectional learning of "what to focus on" and "how to focus" between modalities. In practice, the system first separates the mixed multimodal features into independent modalities (e.g., splitting the four-dimensional feature tensor along the modal dimension), then constructs modal pairs, calculating cross-attention for each pair. During the calculation, features of modality A serve as the "query," and features of modality B serve as the "key" and "value." The system calculates attention weights based on the similarity between the query and the key, and then uses these weights to perform a weighted sum of the values to obtain the cross-attention features from B to A. Intuitively, this process is equivalent to: Modality A asking "What should I focus on?", Modality B answering "These locations are important from my perspective," and then Modality A enhancing the feature representation of the corresponding region based on this guidance. In the specific scenario of livestock monitoring, cross-attention exhibits 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 outlines may be blurred in low light. Through cross-attention, the outline information from thermal imaging can guide the enhancement of corresponding regions in the visible light feature map, helping the system accurately locate livestock boundaries even in low light conditions; simultaneously, the texture details in visible light can also guide thermal imaging to more finely distinguish closely packed livestock individuals. To further improve the fusion effect, the system implements multi-layered cross-attention calculation, calculating cross-attention at multiple levels of the feature extraction network, capturing everything from low-level texture edge correspondences to high-level semantic consistency. The system also incorporates an attention distillation mechanism, which uses the cross-attention patterns of high-level semantic features to guide the cross-attention calculations of low-level features, forming a top-down information flow. This enhances the semantic consistency of features and ultimately generates highly fused multimodal feature representations, providing a solid foundation for accurate livestock segmentation and health status analysis.
[0143] Step S2.4, Multimodal data feature extraction: Based on the biological data stream in step S1 and the visual data in step S2.3, extract time-domain features (mean, variance, peak value, etc.), frequency-domain features (power spectral density, dominant frequency, etc.) and statistical features (entropy, skewness, kurtosis, etc.) to form a multidimensional feature set.
[0144] After completing the visual analysis of livestock, the visual data needs to be combined with biosensor data for feature extraction and fusion to form a multidimensional feature set that comprehensively describes the livestock's condition. This step first extracts features from two key data sources: one is the biodata stream output from step S1, which includes time series of parameters such as body temperature, heart rate, and activity level; the other is the visual data generated in step S2.3, which includes visual analysis results such as body shape and behavioral characteristics. For biological data streams, three key features are extracted: time-domain features reflect the basic statistical characteristics and temporal variation patterns of the data, including mean (reflecting the overall level of the parameter), standard deviation (reflecting the degree of parameter fluctuation), maximum / minimum values (reflecting extreme conditions), slope (reflecting the trend of change), number of peaks (reflecting the frequency of fluctuation), and peak spacing (reflecting periodic changes), etc.; frequency-domain features extract periodic patterns from the time series through Fourier transform or wavelet transform, including power spectral density (showing the distribution of energy at different frequencies), dominant frequency (the most important periodic change frequency), and frequency band energy ratio (reflecting the relative intensity of activities at different time scales), etc. These features help 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 "peaking" 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 the height-to-length ratio) and body condition score trends (visual estimates of weight changes); from behavioral features, it extracts behavioral frequency (such as feeding frequency per day), duration (such as the average duration of each lying down), and transition frequency (such as the number of times standing-to-lying down transitions). These visual features provide behavioral context for biological parameters, helping to understand livestock status more comprehensively. After normalization and outlier processing, all features are organized into a structured multidimensional feature set, ready for the next feature fusion stage. This multidimensional feature extraction not only considers the state at a single point in time but also captures the dynamic change patterns of the time series, reflecting subtle changes and development trends in livestock health status.
[0145] Step S2.5, Feature Fusion and Individualized Feature Vector Generation: Using a multimodal fusion algorithm (such as attention mechanism, graph convolutional network, etc.), the features of biosensor data and visual behavior features are fused to generate an individualized feature vector that comprehensively reflects the health and behavioral status of livestock.
[0146] After acquiring a multi-dimensional feature set, the key challenge is how to effectively fuse these features from different sources with different characteristics to form a unified, personalized feature representation. This step employs an advanced multimodal fusion algorithm to achieve deep integration of biosensor data features and visual behavioral features. The system's fusion strategy is based on three levels: feature-level fusion, decision-level fusion, and hybrid fusion. In feature-level fusion, the system designs a feature weighted network based on an attention mechanism, which can automatically learn the importance weight of each feature in different contexts. For example, when detecting potential heat stress, body temperature and respiratory rate may receive higher weights; while when monitoring feeding anomalies, activity patterns and feeding behavior features may be more critical. The attention mechanism calculates the interrelationships between features through a trainable parameter matrix, generating dynamic weights to achieve context-aware feature importance adjustment. Simultaneously, a graph convolutional network (GCN) is introduced to model the complex dependencies between different features. In GCN, each feature is treated as a node in a graph, and the correlation between features is used as the weight of the edges. Through a message passing mechanism, features can influence and enhance each other, capturing more complex feature interaction patterns. For example, increased heart rate and increased activity are usually normal correlations, but increased heart rate and decreased activity may indicate health problems. GCN can effectively learn these conditional dependencies. In decision-level fusion, the system makes preliminary judgments on different modalities separately, and then fuses the results through methods such as voting or weighted averaging. In hybrid fusion, the advantages of the first two methods are combined, with early fusion on some features and independent processing on others until the decision stage. The fusion process undergoes multiple rounds of iterative optimization to ensure that information from different sources complements each other rather than interferes with each other. Finally, the system generates a high-dimensional feature vector (typically between 200-500 dimensions), which comprehensively contains information on the animal's physiological state, behavioral patterns, and changes in body condition, forming a "digital fingerprint" of the animal's current state. This individualized feature vector has both rich information content, capable of capturing subtle changes in animal health, and good structured characteristics, facilitating the construction of subsequent health baseline models and the application of anomaly detection algorithms. Through this deep fusion, the system can overcome the limitations of a single data source and achieve a comprehensive and accurate representation of the animal's health status.
[0147] like Figure 4 As shown, step S3, the construction of the livestock health baseline model, specifically includes:
[0148] Step S3.1, Historical Data Integration: Receive the individualized feature vector of livestock output from step S2, combine it with the historical health records (immunization, treatment, milk production, etc.) in the breeding module, establish a historical health dataset for individual livestock, and provide training data for the baseline model.
[0149] Establishing a comprehensive historical health dataset is fundamental to building an accurate health baseline model. This process begins with receiving the individualized feature vectors of livestock output from step S2. These vectors contain multidimensional information such as physiological parameters, behavioral characteristics, and morphological indicators, forming the core components 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.), past disease history (disease type, onset time, symptoms, severity, etc.), treatment records (medication information, treatment plan, recovery process, etc.), and production performance data (such as milk yield curves for dairy cows, weight gain rate for beef cattle, reproductive status, etc.). Feeding management records are also collected, such as changes in feed formulation and adjustments to feed amount, which may affect the livestock's physiological state. These heterogeneous data are linked through timestamps to construct a time-series-based historical health profile. During data integration, the system employs various data cleaning techniques to address potential issues: for missing values, time series interpolation, mean imputation, or forward / backward imputation methods are used depending on the data type; for outliers, statistical methods such as median absolute deviation (MAD) or corrected Z-scores are used for detection and correction; for noisy data, techniques such as moving averages or wavelet denoising are applied to smooth the data curves. To ensure data quality, the system also sets data consistency check rules, such as body temperature should not exceed the physiologically possible range and milk production should not exhibit non-physiological drastic fluctuations. The cleaned and validated historical data is organized along a time dimension and labeled with different health status periods such as normal, disease, and recovery periods, so that the model can clearly distinguish the characteristics of normal and abnormal states. Finally, a personalized historical health dataset is constructed for each animal. This dataset includes both long-term trends (such as growth and development curves and seasonal variation 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-night cycles) on biological parameters, establish a background model of parameter fluctuations, and improve the environmental adaptability of the baseline model.
[0151] Livestock physiological parameters are influenced by various periodic and environmental factors. While these changes are not caused by disease, their failure to be identified can lead to numerous false alarms in health monitoring systems. This step aims to establish a background model of parameter fluctuations, distinguishing between normal physiological changes and potential health problems. First, the impact of various physiological cycles on parameters is analyzed. For female livestock, the periodic effects of the estrous cycle (typically around 21 days) on body temperature, activity levels, and behavioral patterns are tracked. Studies show that cattle may experience a slight increase in body temperature (0.3-0.5°C), a 50%-300% increase in activity, and a decrease in feeding behavior during estrus. These regular changes are identified using time-series decomposition techniques and incorporated into the background model. For pregnant livestock, a mapping model between pregnancy stages and physiological parameters is established to capture parameter change patterns specific to different pregnancy stages (early, middle, and late). For example, as pregnancy progresses, the basal metabolic rate increases, baseline body temperature may rise by 0.3-0.6°C, and overall activity levels decrease, but the fluctuation pattern changes. For lactating animals, the correlation between lactation curves and physiological parameters was systematically analyzed, and parameter benchmarks for different lactation stages (peak, sustained, and decline) were established to distinguish between normal lactation physiological changes and health problems.
[0152] Meanwhile, the influence of environmental factors on biological parameters was analyzed in depth. Seasonal variation is one of the most significant environmental factors. A multidimensional response model of season, temperature, humidity, and physiological parameters was established to capture normal adaptive changes under different climatic conditions. For example, during hot seasons, healthy livestock exhibit adaptive changes such as increased respiratory rate, decreased activity, and adjusted feeding times (mostly in the early morning and evening), which are not signs of disease. By collecting long-term data, the system established seasonal adjustment factors to dynamically adjust the normal range of each parameter. The alternation of day and night also affects the physiological rhythms of livestock. Through continuous monitoring of biological parameters, a 24-hour physiological cycle model was established to identify the periodic effects of diurnal variations on parameters such as body temperature, heart rate, and activity. Studies show that the body temperature of healthy cattle typically peaks in the afternoon and evening and is lowest in the morning, with fluctuations ranging from 0.5 to 1.0°C. This variation is a normal manifestation of diurnal rhythm. Weather changes are also an important influencing factor. By systematically linking meteorological data with changes in biological parameters, we can establish models of the impact of weather events such as air pressure changes, precipitation, and strong winds on livestock behavior and physiological parameters, and avoid misjudging short-term weather-related changes as health problems.
[0153] By employing multivariate time series analysis and machine learning techniques, these periodic and environmental influence patterns are extracted from historical data to construct a multifactor background change model. This model utilizes techniques such as mixed-effects statistical models or conditional variational autoencoders to dynamically calculate the "expected normal range" of parameters based on the current physiological cycle stage and environmental conditions. This significantly improves the baseline model's adaptability to various non-disease factors, reduces false alarm rates, and maintains sensitivity to genuine health abnormalities. For example, the system will not misdiagnose a mild increase in respiratory rate during hot summer weather as a respiratory disease, but it can identify abnormal changes exceeding the seasonal adaptation range, achieving 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 individual livestock to learn its normal physiological parameter range, behavioral patterns and changing trends, forming a personalized health reference standard.
[0155] Significant physiological and behavioral differences exist among individual livestock, making it difficult to apply uniform health standards to all individuals. Therefore, this step constructs a personalized health baseline model for each animal. The system trains the individualized model using deep learning algorithms based on the historical dataset integrated in step S3.1 and the background change model established in step S3.2. The system primarily employs recurrent neural network architectures such as Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRUs), which are particularly suitable for processing time series data and can capture long-term dependencies and complex temporal patterns. In terms of model structure design, the system adopts a multi-layer architecture, with a typical configuration containing 2-3 LSTM / GRU layers, each containing 64-128 hidden units, followed by batch normalization layers and Dropout layers (dropout rate 0.2-0.3) to prevent overfitting. The input layer receives multi-dimensional feature vectors containing information such as physiological parameters, behavioral indicators, and environmental conditions; the output layer predicts the expected values and reasonable fluctuation ranges of parameters within future time windows. The system also introduces an attention mechanism, enabling the model to automatically focus on historical time points most relevant to the current prediction, improving the accuracy of time series modeling.
[0156] During training, only data from periods confirmed as "healthy" are used for baseline model training to avoid incorporating abnormal patterns from disease periods into the normal baseline. Training employs a mini-batch stochastic gradient descent algorithm, with batch sizes typically set to 32-64, using the Adam optimizer with an initial learning rate of 0.001 and a learning rate decay strategy. The loss function design combines mean squared error (to ensure prediction accuracy) and smoothed L1 loss (to improve robustness to outliers). To handle differences in magnitude 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 of each parameter but, more importantly, learns the correlations and co-changing patterns between parameters. For example, increased activity levels are usually accompanied by increased heart rate and respiratory rate, which are normal physiological responses; however, if heart rate increases while activity levels remain unchanged, it may indicate a health problem. The system's baseline model can capture these complex parameter interactions, an advantage that simple threshold monitoring cannot achieve.
[0157] To adapt to livestock growth and seasonal changes, a sliding window training strategy is employed, emphasizing recent data while retaining learning outcomes from long-term patterns. For young livestock, due to rapid growth, the model is updated more frequently with a shorter window period; while for adult livestock, model updates are relatively slower, 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 possesses multiple functions: predicting expected normal parameter values for livestock under specific conditions, calculating reasonable fluctuation ranges of parameters, identifying normal correlation patterns between parameters, and detecting abnormal trends in time series. This personalized model significantly improves the accuracy of health monitoring, adapting to the unique physiological characteristics of different livestock and providing a reliable comparative basis for subsequent anomaly detection.
[0158] In terms of model structure design, the system adopts a multi-layer architecture, with a typical configuration containing 2-3 LSTM / GRU layers, each containing 64-128 hidden units. The input layer dimension is consistent with the feature vector length, typically 100-200 dimensions; after the hidden layers, a batch normalization layer is applied to accelerate convergence and improve generalization ability, while a Dropout layer (dropout rate of 0.2-0.3) is applied to prevent overfitting. The output layer is designed in regression mode to predict the expected values and reasonable fluctuation range of parameters within a future time window. Model training uses the mini-batch stochastic gradient descent algorithm, with a batch size typically set to 32-64, using the Adam optimizer, an initial learning rate of 0.001, and a cosine annealing learning rate scheduling strategy. The loss function design combines mean squared error (MSE, to ensure prediction accuracy) and smoothed L1 loss (to improve robustness to outliers), while setting weight coefficients for different parameters to ensure balanced attention to various physiological indicators.
[0159] Step S3.4, Model Validation and Parameter Optimization: Evaluate model performance using cross-validation, calculate metrics such as error rate, precision, and recall, optimize model parameters and structure, and improve the model's generalization ability and stability.
[0160] To ensure the accuracy and reliability of the health baseline model, the system undergoes rigorous model validation and parameter optimization. The validation process employs time-series cross-validation, which respects the temporal order of the data and avoids the "future data leakage" problem that may occur with traditional random cross-validation. Specifically, the health period data is divided into multiple consecutive segments in chronological order. Each validation uses the first N segments to train the model, and the N+1 segments are used to validate performance. Then, a sliding window is added to add another segment, and this process is repeated. Finally, all validation results are summarized 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, measuring the closeness of predicted values to actual values; precision (the proportion of truly abnormal samples among those detected as abnormal), recall (the proportion of correctly detected abnormalities among all true abnormalities), and F1 score (the harmonic mean of precision and recall) for anomaly detection; and time-sensitive metrics such as early detection time (the average number of hours an anomaly is detected before manual identification) and anomaly persistence detection rate (the accuracy of detecting consecutive abnormal states). The system also pays special attention to the model's performance in edge cases, such as seasonal transitions, changes in feed formulation, and rapid environmental changes, to ensure that the model remains stable under various conditions.
[0161] Based on the validation results, the system performs comprehensive parameter optimization to improve model performance. Parameter optimization employs Bayesian optimization, which efficiently explores the parameter space and finds near-optimal parameter combinations with fewer trials. 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 coefficients, etc.), training parameters (learning rate, batch size, number of training epochs, etc.), and feature engineering parameters (time window size, feature combination weights, etc.). For each parameter configuration, the system performs complete cross-validation evaluation, comprehensively considering various performance indicators and model complexity to avoid overfitting risks. During optimization, the system makes 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; while for adult livestock with more stable behavioral patterns, a longer time window and a deeper network structure may be more suitable for capturing complex patterns.
[0162] Optimization also includes adjusting the model structure, such as trying different types of recurrent units (standard LSTM, bidirectional LSTM, GRU, etc.), adding residual connections to improve the training effect of deep networks, and introducing temporal convolutional networks (TCNs) to capture multi-scale temporal patterns. Model ensemble 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 ensembles to further improve prediction stability and accuracy. After comprehensive validation and optimization, the final individualized health baseline model achieved high accuracy and generalization ability, adapting to various environmental conditions and physiological state changes, providing a reliable reference benchmark for real-time health monitoring. The system will also periodically re-evaluate model performance to ensure that the model maintains accuracy as the physiological state of livestock evolves, triggering a model update process when necessary.
[0163] Step S3.5, Baseline Model Adaptive Update: Design an adaptive update mechanism for the baseline model. Based on factors such as livestock growth and development stages and seasonal changes, update the health baseline periodically or triggeredly to ensure the timeliness and accuracy of the model and output a dynamically updated livestock health baseline model library.
[0164] The physiological state of livestock evolves continuously with growth, development, seasonal changes, and production cycles, causing static health baseline models to gradually become ineffective over time. To address this issue, an adaptive update mechanism for the baseline model was 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 time 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 a model update every 2-4 weeks to capture rapidly changing growth and development characteristics; for adult livestock, the update cycle can be extended to 1-3 months, but the frequency will be adjusted according to the production cycle (such as lactation and dry periods). Seasonal changes also trigger model updates, with additional update cycles scheduled during seasonal transitions (spring-summer, summer-autumn, autumn-winter, winter-spring) to adapt to physiological adjustments caused by changes in environmental conditions. Triggered updates are initiated based on specific events or detected state changes, such as significant adjustments to feed formulation, changes in livestock production status (e.g., entering a new lactation period), detected shifts in the stability of physiological parameters (e.g., changes in basal metabolic rate), or a decline in model performance indicators (increased false alarm rate or increased false negatives). This dual mechanism ensures both the timeliness of model updates and the efficiency of resource utilization.
[0165] The update process employs an incremental learning strategy to avoid the "catastrophic forgetting" problem. Instead of completely retraining the model, the system fine-tunes it using the latest collected health status data based on existing model parameters. This approach preserves the basic patterns already learned by the model while adapting to new data distribution characteristics. Specifically, techniques such as Elastic Weight Consolidation are used to add constraints to protect important parameters from drastic changes and slow down the forgetting of old task knowledge. For periodic factors such as seasonal variations, a memory-enhancing network is used to incorporate an explicit memory mechanism for historical seasonal patterns into the model, improving its adaptability to periodic changes. To balance the importance of new and old data, the system uses a time-weighted sampling strategy, giving higher weight to recent data while not completely ignoring long-term patterns in historical data. The update process also includes continuous model evaluation; the system maintains an independent validation dataset to monitor model performance changes, ensuring that updates truly improve rather than degrade model quality.
[0166] After a model update, the system performs version management and deployment. Each update generates a new model version, but the system retains the previous few versions as backups in case of unexpected problems with the new model. A blue-green deployment strategy is used, where the new model and the old model run in parallel for a period of time, and their prediction results are compared to confirm that the new model performs better before a complete switch. A model rollback mechanism is also implemented; if the new model is found to perform poorly under certain conditions, it can be quickly reverted to a previous stable version. All model versions and their performance evaluation results are recorded in the model library, forming a complete evolutionary history. Through this dynamic update mechanism, the health baseline model in the system can continuously evolve to adapt to changes in livestock physiological states, ensuring the timeliness and accuracy of monitoring. The baseline models of all individuals collectively 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.) to provide input data for anomaly detection.
[0169] The first step in real-time health monitoring is the continuous reception and processing of 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 delay of no more than 30 seconds). These feature vectors contain multi-dimensional information, covering various aspects such as physiological parameters, behavioral characteristics, and environmental conditions. The system first verifies the completeness 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 potential outliers, the system applies real-time filtering algorithms to identify and correct data points that exceed reasonable ranges or significantly deviate from recent trends. After ensuring data quality, the system extracts key feature parameters from the complete feature vectors; these parameters are the core input for anomaly detection. Physiological parameters include basic vital signs such as body temperature and its trends (e.g., fluctuation patterns over the past 6 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 (steps or activity count per hour), activity patterns (time distribution of activity and rest), feeding behavior (frequency of feeding, duration of each feeding, and intensity of feeding), rumination behavior (frequency, duration, and frequency of rumination), and social behavior (interaction patterns with the group). Environmental parameters include current temperature, humidity, THI (temperature and humidity index), and the microenvironmental conditions of the livestock's location.
[0170] The system not only focuses on static feature values but also places particular emphasis on time-series features, capturing patterns of parameter changes over time. This includes short-term changes (trends over the last 1-6 hours), intraday patterns (24-hour cycle changes), and recent trends (gradual changes over 3-7 days). For these time series, the system calculates features such as slope, volatility, periodicity, and abrupt change points. These dynamic features often reflect changes in health status more accurately than absolute values at a single time point. The system also pays special attention to the correlations between features, calculating statistics such as correlation coefficients, conditional probabilities, and mutual information between parameter pairs to capture patterns of coordinated changes in multiple parameters. For example, under normal circumstances, increased activity levels are accompanied by an increase in heart rate, but an abnormally high heart rate without a change in activity levels may indicate potential health problems. These extracted key features are standardized and organized into a structured feature set, serving as input for subsequent anomaly detection. The system employs a streaming processing architecture to continuously update features; whenever new data arrives, the feature set is dynamically updated to ensure anomaly detection is based on the latest monitoring information. For computationally intensive features (such as complex time-series pattern recognition), the system uses an incremental computation strategy to avoid repeatedly processing 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 state 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 health 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 abnormalities by accurately comparing real-time status with individualized health baselines. 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 built in step S3. This process employs an efficient model indexing and caching mechanism to ensure rapid access to the latest model version. Simultaneously, the system loads key metadata for the animal, such as age, breed, production stage, and recent health events, providing context for interpreting the model's output. After the model is loaded, current environmental conditions (temperature, humidity, time, season, etc.) and animal status information (e.g., lactation day, pregnancy status, etc.) are input. The model dynamically adjusts the expected normal range of parameters to adapt to the specific situation. For example, in high-temperature environments, the upper limit of normal body temperature for healthy animals will increase accordingly, and an increased respiratory rate is also considered a normal physiological regulatory response.
[0173] Next, the real-time feature vector extracted in step S4.1 is compared with the expected normal state generated by the model in a multidimensional way. The comparison process is not a simple threshold judgment, but a comprehensive evaluation considering 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; a score exceeding ±2 is considered a potential anomaly. The system also analyzes the time trend of the parameters; even if the current value is within the normal range, a significant upward or downward trend may indicate health problems. For behavioral characteristics, the similarity between the current behavioral pattern and historical normal patterns is compared, and pattern matching algorithms are used to detect abnormal behavioral changes, such as interrupted feeding rhythms and abnormal activity patterns. Particularly important, the system evaluates the synergistic relationships between parameters, checking for abnormal parameter combinations, such as simultaneous increases in heart rate and body temperature but decreased activity levels; this inconsistency often indicates health problems. The system uses conditional probability and Bayesian network models to assess the degree of anomalousness of these parameter combinations, capturing complex changes in health status.
[0174] Individual anomaly scores are calculated for each dimension's comparison results, and then a weighted fusion is used to generate an overall anomaly score. Weighting considers the physiological importance of parameters (e.g., changes in body temperature are generally more important than minor fluctuations in activity levels), the duration of the anomaly (persistent anomalies are more concerning than occasional fluctuations), and the magnitude of the anomaly (extreme deviations are more serious than minor overshoots). A temporal anomaly accumulation mechanism is also implemented; if a parameter deviates from the normal range for multiple consecutive time points, its anomaly weight gradually increases, improving 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 the overall anomaly score but also detailed dimensional analysis, indicating which parameters are abnormal, their severity, and the duration of the anomaly, providing a comprehensive basis for further health risk assessment. Through this refined baseline comparison mechanism, the system can accurately identify subtle changes in livestock health status, detect potential health problems early, and create conditions for timely intervention.
[0175] Step S4.3, Application of multidimensional anomaly detection algorithms: Multiple anomaly detection algorithms (such as isolated forest, one-class SVM, deep autoencoder, etc.) are analyzed in parallel. The results of each algorithm are integrated through ensemble learning methods to improve the accuracy and robustness of anomaly detection.
[0176] Livestock health abnormalities manifest in diverse forms, and a single algorithm cannot comprehensively capture all abnormal patterns. Therefore, a multi-algorithm parallel analysis strategy is adopted to comprehensively detect potential health problems. Three types of anomaly detection algorithms are applied simultaneously: statistical methods, traditional machine learning methods, and deep learning methods. Each type includes multiple specific algorithms, forming a comprehensive anomaly detection matrix. Statistical methods include Multivariate Exponential Weighted Moving Average (MEWMA) for detecting asymptotic shifts in parameter means; Generalized Likelihood Ratio Test (GLR) for identifying parameter mutations; Mahalanobis distance for effectively detecting collaborative anomalies of multidimensional features; and Seasonal Decomposition Combined with Cumulative Sum Control Chart (CUSUM) for identifying seasonally adjusted abnormal patterns. These statistical methods are computationally efficient, provide statistically significant interpretations of 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 defines the distribution range of normal samples through boundary learning; Local Outlier Factor (LOF), which detects local outliers based on density estimation; and Elliptic Envelope, which assumes that the data follows a multivariate Gaussian distribution to detect anomalies. These methods are suitable for handling medium-dimensional feature spaces and can capture non-linear anomaly patterns. Deep learning methods include Variational Autoencoders (VAE), which detect anomalies that are difficult to reconstruct through reconstruction errors; Long Short-Term Memory Autoencoders (LSTM-AE), which are specifically designed to capture anomaly patterns in time-series data; Deep Single-Class Classification Networks (Deep SVDD), which maps normal samples to the vicinity of the center of a high-dimensional sphere, while anomalies are located further away from the center; and Graph Neural Networks (GNN), which utilize the graph structure of relationships between parameters to detect anomalies in the graph topology. These deep methods are particularly suitable for anomaly detection in high-dimensional features and complex time series.
[0177] Multiple sets of parameters are configured for each algorithm, generating rich anomaly detection perspectives. To effectively integrate the results of these algorithms, the system employs an ensemble learning framework. The core idea is "brainstorming," synthesizing the judgments of multiple algorithms to arrive at more reliable anomaly detection conclusions. The system uses a weighted voting method, where the weights of each algorithm are dynamically adjusted based on its historical performance, with algorithms achieving higher accuracy receiving higher weights. Stacking ensemble technology is also introduced to train a meta-learner to integrate the outputs of various basic algorithms, learning more complex combination patterns. To address the correlation between algorithms, the system applies correlation analysis and principal component analysis to ensure that algorithms from different perspectives receive appropriate attention during the integration process, avoiding the overemphasis on the viewpoints of similar algorithms. The integration process not only focuses on the binary judgment of whether an anomaly exists but also integrates the assessments of the degree of anomaly by each algorithm, forming a continuous anomaly score spectrum. This score design enables the system to distinguish between minor and severe anomalies, providing a foundation for subsequent risk classification.
[0178] An adaptive enhancement mechanism for anomaly detection has also been implemented. For cases initially identified as abnormal, the data collection frequency is dynamically increased to obtain more intensive monitoring data for secondary analysis. This feedback mechanism improves the accuracy of judging borderline cases. Furthermore, the sensitivity of anomaly detection is dynamically adjusted based on the characteristics and historical health status of different livestock. For example, more sensitive detection parameters are used for livestock with a history of disease, while more conservative anomaly judgment criteria may be used for stable, healthy individuals to reduce false alarms. Through this multi-algorithm collaborative and ensemble learning-integrated anomaly detection framework, the system can accurately identify various types of health anomalies, including sudden and rapid changes, gradual and slow deterioration, periodic abnormal patterns, and multi-parameter collaborative anomalies, providing comprehensive and reliable anomaly detection support for livestock health management.
[0179] For anomaly detection algorithm configuration, the Isolation Forest algorithm uses 100-200 trees, a subsampling size of 256, and a contamination parameter of 0.01. The Single-Class SVM uses the RBF kernel function with a kernel coefficient γ of 0.1 and an anomaly proportion parameter of 0.05. The Deep Autoencoder uses a symmetrical structure, with the encoder part defined as [input_dim, 128, 64, 32] and the decoder part as [32, 64, 128, input_dim]. It uses the ReLU activation function and determines anomalies based on a reconstruction error threshold (typically set to the 95th percentile of the reconstruction error in the training set). The weights of each algorithm are initially set to be 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 weight allocation based on the F1 score to ensure that high-performance algorithms gain greater influence. To reduce algorithm noise, the system introduces a time smoothing technique, requiring three consecutive detections to be classified as anomalies before triggering the final anomaly label, 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, conduct a risk assessment of the current health status of livestock, classifying it into four levels: normal, mildly abnormal, moderately abnormal, and severely abnormal, and analyze the possible types of health problems.
[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 livestock management decisions. First, based on the anomaly detection results from step S4.3, key anomaly features are extracted, including the combination of abnormal parameters, the duration of the anomaly, the trend of the anomaly, and the distribution of the anomaly's severity. These features form a multidimensional description of the current health status, which the system matches and analyzes against a built-in veterinary knowledge base. The knowledge base contains hundreds of common livestock health problems and their characteristic manifestations, constructed and regularly updated by a team of veterinary experts. The matching process employs fuzzy logic and a rule-based reasoning system to calculate the similarity between the current anomaly pattern and various known health problems, identifying the most likely type of health problem. Simultaneously, the system also considers the moderating effect 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 between hot seasons and cold seasons; the risk interpretation of certain anomalies may also differ between primiparous and multiparous cows.
[0182] Based on comprehensive analysis, the current health status of livestock is categorized into four risk levels. "Normal" indicates that the livestock's physiological parameters and behavioral patterns are within the expected range of the individual's health baseline, with no obvious abnormal signals detected. "Mild Abnormality" indicates slight deviations or short-term fluctuations in certain parameters, possibly reflecting initial health changes or environmental adaptation responses, requiring increased observation but not yet urgent intervention. "Moderate Abnormality" indicates the discovery of obvious and persistent abnormal patterns, indicating that potential health problems are developing, and recommends preventative measures and consideration of professional examination. "Severe Abnormality" indicates the detection of critical health indicator changes, such as significantly abnormal body temperature, severe deviations in key physiological parameters, or simultaneous abnormalities in multiple systems, indicating that the livestock may be in a high-risk state and requires immediate professional intervention. The system also calculates a confidence level for each risk level to reflect the reliability of the assessment results, avoiding overly confident judgments when data is insufficient or patterns are unclear.
[0183] While classifying health risks, the system also conducts a more refined analysis of health problem types. First, it performs systemic localization analysis to identify the main physiological systems that may be affected, such as the respiratory, digestive, reproductive, musculoskeletal, or multi-system syndromes. Next, it infers the etiology, assessing whether the abnormalities might be attributed to infectious factors (e.g., bacterial or viral infections), metabolic factors (e.g., ketosis, hypocalcemia), traumatic factors, stress factors, or nutritional factors. The system also predicts development trends, using time-series analysis to determine whether the health status is improving, stable, deteriorating, or fluctuating. Finally, the system generates a comprehensive health risk report, including risk level, key abnormal parameters, possible health problem types, predicted development trends, and confidence level assessment. This report employs a hierarchical design, with a concise risk overview at the top level and progressively detailed diagnostic information at the bottom, allowing livestock managers to obtain appropriately in-depth health status information as needed. Through this systematic health risk assessment and classification, the system transforms complex, multi-dimensional abnormality detection results into clinically significant health status assessments, 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 a 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 the field of livestock health monitoring. By combining infrared thermal imaging and visible light imaging, the normalized difference index of different regions on the livestock's body surface is calculated, forming a health heatmap reflecting the distribution of body surface temperature and blood circulation. Then, multi-source features, including these indices, physiological parameters, and behavioral characteristics, are integrated, and a multi-dimensional health status classification is performed through a fully connected neural network, including four dimensions: health level, etiology type, systemic location, and development trend. Interpretable analysis is provided, significantly improving the accuracy and granularity of health status assessment.
[0185] The NDVI-derived index is calculated using the formula: NDVI = (NIR - RED) / (NIR + RED), where NIR represents near-infrared reflectance and RED represents visible red band reflectance. In livestock monitoring applications, the system innovatively applies a similar formula to thermal imaging and visible light images: 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 body surface into 12 key regions, calculates the NDVI-like index for each region, and constructs a livestock health heatmap.
[0186] For dairy cows, the system typically sets the normal health index range to 0.15-0.35, mild abnormalities to 0.35-0.45 or 0.10-0.15, moderate abnormalities to 0.45-0.60 or 0.05-0.10, and severe abnormalities to >0.60 or <0.05. Different body regions also have corresponding fine-tuning parameters. Temperature variation patterns are also an important criterion. For example, normal cows usually maintain a 2-4°C temperature gradient between different body regions, while this gradient undergoes characteristic changes under abnormal conditions.
[0187] In step S4.4, based on the anomaly detection results and combined with expert knowledge rules, the specific implementation of the risk assessment of the livestock's current health status is as follows:
[0188] S4.4.1 Innovative application of NDVI technology in livestock health monitoring: By combining infrared thermal imaging and visible light imaging, multiple key areas (such as head, neck, chest and abdomen, limbs, etc.) are divided on the surface of livestock. The normalized difference index of different key areas on the surface of livestock is calculated to form a livestock health heat map similar to a "healthy vegetation map", which reflects the surface temperature distribution pattern, blood circulation status and metabolic activity level.
[0189] S4.4.2 Multi-source feature fusion and preprocessing: Integrate the normalized difference index, physiological parameter features (such as body temperature change curve, heart rate change pattern, respiratory rate, etc.), behavioral features (such as activity level changes, feeding duration, rumination frequency, standing-to-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, which includes an input layer, multiple hidden layers and an output layer. The ReLU activation function is used between each layer to increase the non-linear expressive power.
[0191] S4.4.4 Fine-grained classification system of health status: Through the multi-task learning structure of the network, the system simultaneously outputs assessment results in four dimensions: health level classification (complete health, sub-health, mild abnormality, moderate abnormality and severe abnormality), etiology type classification (infectious, metabolic, traumatic, stress, 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, generating a contribution waterfall chart to intuitively show which indicators are abnormal and cause the current classification result, providing interpretability 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 visualization manner, generate structured abnormal alarms containing information such as abnormal dimensions, 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, specifically includes:
[0195] Step S5.1, Early Warning Rule Configuration and Management: Receive the health status assessment results from Step S4, and configure differentiated early warning rules based on factors such as livestock breed, age, and breeding goals. These rules include early warning thresholds, early warning levels, and response strategies to achieve personalized and precise early warning.
[0196] Step S5.2, Generation of multi-level early warning information: Based on the health risk assessment results and early warning rules, generate graded early warning information: a reminder-level early warning is issued for mild abnormalities, a warning-level early warning is issued for moderate abnormalities, and an emergency-level early warning is issued for severe abnormalities, along with possible health problem diagnosis and treatment suggestions.
[0197] Step S5.3, Multi-channel early warning information push: Based on the early warning level and configuration, push early warning information to farmers through multiple channels (APP push, SMS, automatic telephone notification, etc.) to ensure that key early warnings can be delivered in a timely manner and improve response efficiency.
[0198] Step S5.4, Intervention Recommendations and Implementation Tracking: Generate specific intervention recommendations for different types of health abnormalities, including key observation points, basic treatment methods, and the timing of professional veterinary intervention, and record the actual intervention measures and implementation results of the breeding personnel.
[0199] Step S5.5, Early Warning Effect Feedback and Continuous Optimization: Collect the intervention results and feedback from aquaculture personnel 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 to use edge computing devices to clean, denoise and preprocess the livestock biological data and environmental parameters to obtain a standardized multidimensional livestock data stream.
[0202] The individual identification and feature fusion module 200 is used to receive the standardized multidimensional livestock data stream, combine it with the livestock image data provided by the video monitoring system, identify individual livestock through computer vision algorithms and analyze behavioral characteristics and body shape changes to obtain livestock visual data, and perform multi-source feature fusion of the biological data of the standardized multidimensional livestock data stream and the livestock visual data to generate individualized livestock feature vectors.
[0203] The health baseline model construction module 300 is used to receive the individualized feature vector of the livestock, combine it with historical health records, construct an individualized health baseline model through machine learning algorithms, and output a livestock health baseline model library.
[0204] The health monitoring and anomaly detection module 400 is used to receive the individualized feature vector of the livestock and the livestock health baseline model library, compare the deviation between the current state and the health baseline through anomaly detection algorithm, identify potential health problems, and output health status assessment results and anomaly alarms.
[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, issue graded early warnings and generate intervention suggestions according to the severity of the abnormality, push early warning information to farmers through multiple channels, record response measures and results, and form a closed-loop management system.
[0206] The system also includes:
[0207] The data storage module 600 is used to store data such as individual livestock information, historical health records, biological data, environmental parameters, and early warning records;
[0208] The system management module 700 is used to manage user permissions, device status, and system configuration.
[0209] The communication interface module 800 is used to realize data exchange between the system and external devices and services;
[0210] User interaction module 900 is used to provide a graphical interface to display livestock health status and early warning information;
[0211] The data analysis module 1000 is used to deeply mine historical data and discover potential health risk patterns.
[0212] It should be noted that the ring artifact correction technique based on the interaction of global and local features in the projection domain in the method of this invention is shown below. It is mainly used to address image quality problems caused by complex lighting conditions in livestock farms. Through the interaction guidance of global and local features in the projection domain, adaptive enhancement and correction of the image are achieved. This technique, as a sub-step of step S2.2 "Video Image Acquisition and Preprocessing" in the original technical solution, intelligently corrects common environmental artifacts in monitoring video images, improving the accuracy of subsequent visual analysis.
[0213] The livestock health status accurate classification technology based on NDVI and fully connected neural networks in this invention is as follows: By innovatively transferring the concept of NDVI (Normalized Difference Vegetation Index) to the field of livestock health monitoring, a set of NDVI-like health index systems has been developed. This technology, as the implementation method of step S4.4 "Health Risk Assessment and Grading", can more accurately describe the health status of livestock and improve the accuracy and granularity of health status classification.
[0214] The livestock multimodal image segmentation technology based on 3D multiscale self-attention and cross-attention in this invention is as follows: By fusing multiple imaging modalities and advanced attention mechanisms, it achieves high-precision and robust segmentation of livestock, providing a solid foundation for subsequent health feature extraction and analysis. This technology, as the implementation method of step S2.3 "Computer Vision Recognition and Analysis," solves the problem of traditional image segmentation methods performing poorly in complex environments.
[0215] The method and system for real-time monitoring of livestock health status based on the Internet of Things described in this invention can be 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 at an early stage, providing decision support for livestock management.
[0216] This invention has described specific embodiments, but these are merely preferred embodiments and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should be considered within the scope of this invention.
Claims
1. A method for real-time monitoring of livestock health status based on the Internet of Things, characterized in that, include: Livestock biological data and environmental parameters are collected by biochip ear tags and environmental sensors. The livestock biological data and environmental parameters are cleaned, denoised and preprocessed by edge computing devices to obtain a standardized multidimensional livestock data stream. The system receives the standardized multidimensional livestock data stream, combines it with livestock image data provided by the video monitoring system, identifies individual livestock through computer vision algorithms and analyzes their behavioral characteristics and body shape changes to obtain livestock visual data. The system then performs multi-source feature fusion between the biological data from the standardized multidimensional livestock data stream and the livestock visual data to generate individualized livestock feature vectors. Receive the individualized feature vector of the livestock, combine it with historical health records, construct an individualized health baseline model through machine learning algorithms, and output a livestock health baseline model library; The system receives the individualized feature vector of the livestock and the livestock health baseline model library, compares the deviation between the current state and the health baseline using an anomaly detection algorithm, identifies potential health problems, and outputs a health status assessment result. The system receives the health status assessment results, combines them with preset early warning rules, issues graded early warnings based on the severity of the abnormalities, generates intervention suggestions, pushes early warning information to farmers through multiple channels, records response measures and results, and forms a closed-loop management system. The process involves receiving the standardized multidimensional livestock data stream, combining it with livestock image data provided by the video monitoring system, identifying individual livestock using computer vision algorithms, analyzing behavioral characteristics and body shape changes to obtain livestock visual data, and then fusing the biological data from the standardized multidimensional livestock data stream with the livestock visual data using multi-source features to generate individualized livestock feature vectors, including: Receive ear tag ID information from the standardized multidimensional livestock data stream, combine it with the livestock electronic record database, extract the basic information of the target livestock, and establish a unique mapping relationship between the ear tag ID information and the individual livestock; The livestock image data is collected in real time by the camera system in the farm. The livestock image data is then preprocessed by denoising, illumination compensation and geometric correction to obtain preprocessed livestock image data. Using deep learning models to process preprocessed livestock image data, we can achieve livestock target detection, individual recognition, and behavior analysis, and extract livestock visual data based on body shape and behavioral characteristics. Based on the biological data and visual data of the standardized multidimensional livestock data stream, time-domain features, frequency-domain features and statistical features are extracted to form a multidimensional feature set; A multimodal fusion algorithm is used to fuse the biosensor data features and visual behavior features of the multidimensional feature set to generate an individualized feature vector that comprehensively reflects the health and behavioral status of livestock. The preprocessing of the livestock image data, including denoising, illumination compensation, and geometric correction, includes: A multi-scale feature pyramid is constructed, with a low-level network capturing local features and a deep network capturing global features. Livestock image features containing both global and local features are extracted from the livestock image data. The extracted livestock image features are mapped to the projection domain space, in which the image content and environmental artifact components are separated, so that the content information and artifacts can be distinguished in the projection space. The interactive attention module uses global features to guide artifact recognition in local areas, and feeds back statistical information of the local features to guide global artifact pattern recognition, resulting in interactive image features. Based on the image features after the interaction, the artifact distribution map in the original livestock image is estimated, and a corrected image is generated using residual learning, which preserves the original details while removing artifacts. Based on the characteristics of images under different times and weather conditions, the enhancement parameters and correction intensity are adjusted to ensure clear livestock images are obtained in various environments.
2. The method according to claim 1, characterized in that, Livestock biological data and environmental parameters are collected using biochip ear tags and environmental sensors. Edge computing devices are then used to clean, denoise, and preprocess this data to obtain a standardized, multi-dimensional livestock data stream, including: Biochip ear tags are installed on the ears of livestock to collect data on body temperature, heart rate and activity level. At the same time, environmental sensors are deployed in the pens to collect data on temperature, humidity and ammonia concentration, forming an Internet of Things 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 when the livestock is stationary, 3 minutes / time when the livestock is active, and 30 seconds / time when the livestock is in an abnormal state. The edge computing device receives raw sensor data, performs data cleaning to remove outliers, performs wavelet transform filtering and time window moving average processing to reduce data transmission volume; Z-score standardization is performed on sensor data from different sources and dimensions, and the data is aligned according to timestamps to solve the problem of asynchronous acquisition time of multi-source data; The system uses low-power wide-area network to transmit standardized data, implements hierarchical data caching and breakpoint resume, ensures data integrity under unstable network conditions, and outputs standardized multidimensional livestock data streams.
3. The method according to claim 1, characterized in that, The process involves receiving the individualized feature vectors of the livestock, combining them with historical health records, constructing an individualized health baseline model using machine learning algorithms, and outputting a livestock health baseline model library, including: Receive the individualized feature vector of the livestock, combine it with the historical health data in the breeding records, establish the historical health dataset of the individual livestock, and provide training data for the individualized health baseline model; The study analyzes the influence of livestock physiological cycles and environmental factors on biological parameters, establishes a background model of parameter fluctuations, and improves the environmental adaptability of the individualized health baseline model. Based on the time-series model, an individualized health baseline model is created for each animal, learning its normal physiological parameter range, behavioral patterns and trends of change, and forming a personalized health reference standard. The model performance was evaluated using cross-validation, and the error rate, precision, and recall metrics were calculated. The model parameters and structure of the individualized health baseline model were optimized to improve the model's generalization ability. The individualized health baseline model is designed with an adaptive update mechanism to regularly update the health baseline based on the livestock's growth and development stage and seasonal changes, ensuring the model's timeliness and accuracy.
4. The method according to claim 1, characterized in that, The process of receiving the individualized feature vector of the livestock and the livestock health baseline model library, comparing the 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: Receive the individualized feature vector of the livestock, extract key feature parameters, and provide input data for anomaly detection; The individualized health baseline model of the corresponding livestock is called from the livestock health baseline model library, and the real-time features are compared with the baseline model to calculate the deviation and anomaly score of each dimension parameter. Multiple anomaly detection algorithms are analyzed in parallel, and the results of each algorithm are combined through ensemble learning to improve the accuracy and robustness of anomaly detection; Based on the anomaly detection results and combined with expert knowledge rules, a risk assessment is conducted on the current health status of livestock to obtain the health status assessment results; wherein, the health status assessment results include four levels: normal, mildly abnormal, moderately abnormal, and severely abnormal. The health status assessment results are presented in a visual manner, generating structured anomaly alerts that include information on the dimensions, degree, location, and time of the anomalies.
5. The method according to claim 4, characterized in that, The process of assessing the current health status of livestock based on anomaly detection results and expert knowledge rules yields the following health status assessment results: By combining infrared thermal imaging and visible light imaging, multiple key regions are divided on the surface of livestock. The normalized difference index of different key regions on the surface of livestock is calculated to form a livestock health thermal map, which reflects the surface temperature distribution pattern and blood circulation status. By integrating the normalized difference index, physiological parameter features, behavioral features, output indicators, and historical health records, a comprehensive feature vector is formed through feature standardization and time-series data alignment. 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. Through the multi-task learning structure of the network, evaluation results in four dimensions are simultaneously output: health status classification, etiology type classification, system location classification, and development trend classification. The SHAP method is used to calculate the contribution value of each feature to the classification result, generating a contribution waterfall plot to provide interpretable evidence for health status assessment.
6. The method according to claim 1, characterized in that, The process involves receiving the health status assessment results, combining them with preset early warning rules, issuing graded early warnings based on the severity of the abnormalities, generating intervention suggestions, pushing early warning information to farmers through multiple channels, recording response measures and results, and forming a closed-loop management system, including: Configure differentiated early warning rules based on livestock breed, age, and breeding objectives, including early warning thresholds, early warning levels, and response strategies; Based on the health status assessment results and early warning rules, a hierarchical early warning information is generated, which includes early warning levels and configurations. Mild abnormalities trigger a reminder-level early warning, moderate abnormalities trigger a warning-level early warning, and severe abnormalities trigger an emergency-level early warning. Based on the aforementioned tiered early warning information, early warning information is pushed to aquaculture personnel through various channels such as application push, SMS and automatic telephone notification to ensure that key early warnings are delivered in a timely manner. Generate intervention recommendations for different types of health abnormalities, including key observation points, basic treatment methods, and the timing of professional veterinary intervention, and record the actual intervention measures taken by the farmers; Collect the intervention results and feedback from aquaculture personnel after the early warning, evaluate the accuracy and effectiveness of the early warning, and continuously optimize the anomaly detection algorithm and early warning rules.
7. The method according to claim 1, characterized in that, The process of using a deep learning model to process the preprocessed livestock image data to achieve livestock target detection, individual identification, and behavior analysis includes: Multiple modal images, including visible light images, infrared thermal images, depth images, and near-infrared images, are acquired, and spatial alignment and temporal synchronization are performed to ensure that different modal images capture the same scene at the same time, resulting in processed multi-modal image data. Based on the processed multimodal image data, a four-dimensional input tensor containing multiple modalities is constructed. Feature extraction is performed through a three-dimensional convolutional neural network. Convolution operations are performed in the spatial and modal dimensions to learn the correlation patterns between different modalities and obtain multimodal features. Based on the aforementioned multimodal features, a multi-scale three-dimensional feature extraction network is used, employing an encoder-decoder structure and dilated three-dimensional convolution to expand the receptive field, 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, which decomposes the input feature map into feature representations of multiple scales, calculates a self-attention map for each scale, and captures the dependencies between distant features. By using the cross-attention modality fusion mechanism, the features of one modality guide the feature extraction process of another modality, thereby enhancing information exchange and mutual guidance between different modalities.
8. The method according to claim 1, characterized in that, The method is applied to the health monitoring of dairy cows, beef cattle, pigs, or sheep. By collecting and analyzing biological data, environmental parameters, and behavioral data in real time, it can identify potential health risks at an early stage and provide decision support for livestock management.
9. A real-time monitoring system for livestock health status based on the Internet of Things, characterized in that, include: The data acquisition and preprocessing module is used to collect livestock biological data and environmental parameters through biochip ear tags and environmental sensors, and to use edge computing devices to clean, denoise and preprocess the livestock biological data and environmental parameters to obtain a standardized multidimensional livestock data stream. The individual identification and feature fusion module is used to receive the standardized multidimensional livestock data stream, combine it with the livestock image data provided by the video monitoring system, identify individual livestock through computer vision algorithms and analyze behavioral characteristics and body shape changes to obtain livestock visual data, and perform multi-source feature fusion of the biological data of the standardized multidimensional livestock data stream and the livestock visual data to generate individualized livestock feature vectors. The individual identification and feature fusion module is specifically used for: receiving ear tag ID information from the standardized multidimensional livestock data stream, combining it with the livestock electronic record database, extracting basic information of the target livestock, and establishing a unique mapping relationship between the ear tag ID information and the individual livestock; collecting real-time livestock image data through the camera system in the farm, and performing noise reduction, illumination compensation and geometric correction preprocessing on the livestock image data to obtain preprocessed livestock image data; The preprocessed livestock image data is processed using a deep learning model to achieve livestock target detection, individual recognition, and behavior analysis, extracting livestock visual data of body shape and behavioral characteristics; based on the standardized multidimensional livestock data stream biological data and the livestock visual data, time-domain features, frequency-domain features, and statistical features are extracted to form a multidimensional feature set; a multimodal fusion algorithm is used to fuse the biological sensor data features and visual behavioral features of the multidimensional feature set to generate an individualized feature vector that comprehensively reflects the health and behavioral status of livestock; The preprocessing of the livestock image data, including denoising, illumination compensation, and geometric correction, comprises: constructing a multi-scale feature pyramid, where a low-level network captures local features and a deep network captures global features; extracting livestock image features containing both global and local features from the livestock image data; mapping the extracted livestock image features to a projection domain space, separating image content from environmental artifacts in this space to distinguish content information and artifacts in the projection space; using an interactive attention module to guide artifact recognition in local areas using global features, while simultaneously feeding back statistical information from the local features to guide global artifact pattern recognition, resulting in interactive image features; estimating the artifact distribution map in the original livestock image based on the interactive image features; generating a corrected image using residual learning to preserve original details while removing artifacts; and adjusting enhancement parameters and correction intensity according to image characteristics under different times and weather conditions to ensure clear livestock images are obtained in various environments. The health baseline model construction module is used to receive the individualized feature vectors of the livestock, combine them with historical health records, construct an individualized health baseline model through machine learning algorithms, and output a livestock health baseline model library. The health monitoring and anomaly detection module is used to receive the individualized feature vector of the livestock and the livestock health baseline model library, compare the deviation between the current state and the health baseline through anomaly detection algorithm, identify potential health problems, and output health status assessment results and anomaly alarms. 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, issue graded early warnings and generate intervention suggestions according to the severity of the abnormality, push early warning information to farmers through multiple channels, record response measures and results, and form a closed-loop management system.
10. A real-time monitoring system for livestock health status based on the Internet of Things according to claim 9, characterized in that, The real-time livestock health status monitoring system also includes: The data storage module is used to store individual livestock information, historical health records, biological data, environmental parameters, and early warning records. The system management module is used to manage user permissions, device status, and system configuration. The communication interface module is used to enable data exchange between the system and external devices and services; The user interaction module provides a graphical interface to display livestock health status and early warning information. The data analysis module is used to deeply mine historical data and discover potential health risk patterns.
Citation Information
Patent Citations
Method and system for monitoring abnormal behaviors of livestock raising
CN116702051A
Livestock disease prevention and control monitoring and early warning system based on Internet of Things
CN119905255A