Time sequence attention network model construction method for early warning of diarrhea of live pigs
By constructing a temporal attention network model for early warning of swine diarrhea, the problem of weakened early signals caused by neglecting the spatiotemporal correlation between environmental factors and physiological indicators in the early warning model of swine diarrhea was solved, and efficient multimodal data fusion and early warning were achieved.
Patent Information
- Application Number
- CN202511319879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-16
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-16
AI Technical Summary
Existing early warning models for swine diarrhea mostly rely on data from a single sensor, ignoring the spatiotemporal correlation between environmental factors and physiological indicators. This results in weak early signals being masked by noise, leading to poor early warning effectiveness.
A temporal attention network model for early warning of pig diarrhea is constructed. By obtaining physiological indicators and environmental factor data, preprocessing and feature extraction are performed, and the time series modeling module of deep learning is used to generate initial feature vectors. Temporal weight labeling and cross-modal temporal association analysis are performed, and a multimodal feature matrix is generated and mapped with the health status knowledge graph to generate warning items.
It significantly improves the accuracy and reliability of early warning of swine diarrhea, effectively capturing early weak signals and providing scientific health management support.
Smart Images

Figure CN120809251A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of disease early warning technology that combines bioinformatics technology with artificial intelligence technology, and specifically provides a method for constructing a temporal attention network model for early warning of pig diarrhea. Background Art
[0002] With the development of large-scale and intelligent pig farming, disease early warning models based on sensor data have become an important means of ensuring pig health. However, existing early warning models for pig diarrhea often rely on single sensor data, ignoring the spatiotemporal correlation between environmental factors and physiological indicators during analysis. This results in weak early signals being easily masked by noise, limiting the effectiveness of early warnings.
[0003] Among current technical solutions, some studies attempt to integrate multi-source data to improve early warning accuracy. However, when processing multimodal data, they focus more on data heterogeneity and missing information, and their ability to model dynamic relationships between different modalities is relatively weak. Furthermore, these methods fail to fully consider the temporal nature of pigs' physiological state and environmental changes, resulting in a lack of flexibility in data weighting and making it difficult to effectively extract and provide early warnings for weak signals.
[0004] The above issues indicate that existing swine diarrhea early warning technologies still have room for improvement in multimodal data fusion, dynamic weight allocation, and temporal correlation modeling. Therefore, this paper proposes a cross-modal temporal attention fusion mechanism, which aims to achieve efficient fusion of multi-source data through dynamic weight allocation, explore deep correlations between swine physiological indicators and environmental factors, and thus improve the accuracy and reliability of early warnings. Summary of the Invention
[0005] The purpose of the present invention is to provide a method and system for constructing a temporal attention network model for early warning of pig diarrhea, so as to solve the technical problem in the prior art that the pig diarrhea early warning model mostly relies on single sensor data and ignores the spatiotemporal correlation between environmental factors and physiological indicators, resulting in early weak signals being masked by noise.
[0006] In view of the above problems, the present invention provides a method and system for constructing a temporal attention network model for early warning of pig diarrhea, the method comprising the following steps:
[0007] Obtain the physiological index data and environmental factor data of pigs, and pre-process these raw data to generate standardized data sequences;
[0008] Call the deep learning-based time series modeling module to extract features from the standardized data sequence and generate an initial feature vector set;
[0009] Time series weight marking is respectively performed on each feature vector in the initial feature vector set to determine a time series weight set, wherein the time series weight set contains a timestamp label and a dynamic weight coefficient;
[0010] Cross-modal time series correlation analysis is performed based on the timestamp label and the dynamic weight coefficient to determine an inter-modal correlation direction and an inter-modal correlation strength;
[0011] Multi-modal data features from multiple sensors are collected to generate a multi-modal feature matrix;
[0012] Time series alignment is performed on the multi-modal feature matrix based on the inter-modal correlation direction and the inter-modal correlation strength to generate an aligned feature matrix;
[0013] The aligned feature matrix is mapped with a health state knowledge graph node to generate a warning entry and store it to a database.
[0014] Preferably, the physiological index data and the environmental factor data of the live pigs are acquired, and the raw data is preprocessed to generate a standardized data sequence, specifically including:
[0015] The body temperature, heart rate and feed intake data of the live pigs are collected in real time through a wearable sensor;
[0016] The temperature, humidity, ammonia concentration and carbon dioxide concentration data in the pig house are collected in real time through an environmental monitoring device;
[0017] The collected data is cleaned to remove outliers and missing values;
[0018] The cleaned data is normalized by using a Z-score standardization method to adjust the mean value of each type of data to zero and the standard deviation to one.
[0019] Preferably, a deep learning-based time series modeling module is called to extract features from the standardized data sequence to generate an initial feature vector set, specifically including:
[0020] The standardized data sequence is input into a long short-term memory network model;
[0021] Deep features in the standardized data sequence are extracted through a forgetting gate, an input gate and an output gate mechanism;
[0022] The hidden state of each time step is taken as a component of the initial feature vector to form the initial feature vector set.
[0023] Preferably, time series weight marking is respectively performed on each feature vector in the initial feature vector set to determine a time series weight set, specifically including:
[0024] The similarity between each feature vector and other feature vectors is calculated;
[0025] The similarity is converted into a dynamic weight coefficient by a Softmax function;
[0026] A timestamp label is assigned to each feature vector to form a time sequence weight set containing the timestamp label and the dynamic weight coefficient.
[0027] Preferably, the cross-modal time sequence correlation analysis based on the timestamp label and the dynamic weight coefficient determines the inter-modal correlation direction and the inter-modal correlation strength, specifically including:
[0028] The front-back relationship of different modal data on the time axis is calculated to determine the inter-modal correlation direction;
[0029] The cosine similarity between the feature vectors of different modal data is calculated to determine the inter-modal correlation strength.
[0030] Preferably, the multi-modal data features from multiple sensors are collected to generate a multi-modal feature matrix, specifically including:
[0031] The data collected by the multiple sensors are sorted according to the timestamp to ensure the consistency of the time sequence of the modal data;
[0032] The feature vectors of each modal data are spliced into a multi-modal feature matrix, each row of the matrix corresponding to the data of a time step and each column corresponding to the features of a modal.
[0033] Preferably, the multi-modal feature matrix is time sequence aligned based on the inter-modal correlation direction and the inter-modal correlation strength to generate an aligned feature matrix, specifically including:
[0034] The time axis of each modal data is adjusted according to the inter-modal correlation direction so that the modal data with strong correlation are aligned in time;
[0035] The aligned data are weighted and fused according to the inter-modal correlation strength to generate the aligned feature matrix.
[0036] Preferably, the aligned feature matrix is mapped with the nodes of the health state knowledge graph to generate a warning entry and store it to the database, specifically including:
[0037] Each feature vector in the aligned feature matrix is matched with the nodes in the health state knowledge graph;
[0038] The cosine similarity is calculated between the feature vector and the node vector to select the node with the highest similarity as the health state category corresponding to the current feature vector;
[0039] A warning entry containing the pig number, timestamp, health state category, and warning level is generated and stored to the database.
[0040] Preferably, the health status knowledge graph is stored and managed using a graph database, and the graph database includes Neo4j or JanusGraph.
[0041] The present invention provides a temporal attention network model construction system for early warning of swine diarrhea, which is used to execute the above-mentioned temporal attention network model construction method for early warning of swine diarrhea. The system includes:
[0042] A data preprocessing module is used to obtain physiological indicator data and environmental factor data of pigs, and preprocess these raw data to generate standardized data sequences;
[0043] A feature extraction module is used to call a deep learning-based time series modeling module to extract features from the standardized data sequence and generate an initial feature vector set;
[0044] A timing weight labeling module, wherein the timing weight labeling module is used to label each feature vector in the initial feature vector set with a timing weight to determine a timing weight set;
[0045] A modal correlation analysis module, which is used to perform cross-modal temporal correlation analysis based on timestamp tags and dynamic weight coefficients to determine the direction and strength of inter-modal correlation;
[0046] A multimodal feature acquisition module, which is used to collect multimodal data features from multiple sensors and generate a multimodal feature matrix;
[0047] A timing alignment module, configured to perform timing alignment on a multimodal feature matrix based on an inter-modal correlation direction and an inter-modal correlation strength to generate an aligned feature matrix;
[0048] The knowledge graph mapping module is used to map the alignment feature matrix with the health status knowledge graph nodes, generate warning entries and store them in the database.
[0049] Compared with the prior art, the present invention has the following beneficial effects:
[0050] By acquiring the physiological index data and environmental factor data of live pigs, the original data is preprocessed to generate standardized data sequences; a time series modeling module based on deep learning is called to extract features from the standardized data sequences to generate an initial feature vector set; each feature vector in the initial feature vector set is labeled with a time sequence weight to determine a time sequence weight set, wherein the time sequence weight set contains a timestamp label and a dynamic weight coefficient; cross-modal time sequence correlation analysis is performed based on the timestamp label and the dynamic weight coefficient to determine the inter-modal correlation direction and the inter-modal correlation strength; multi-modal data features from multiple sensors are collected to generate a multi-modal feature matrix; the multi-modal feature matrix is time-aligned based on the inter-modal correlation direction and the inter-modal correlation strength to generate an aligned feature matrix; the aligned feature matrix is mapped to a health state knowledge graph node to generate a warning item and store it in a database. Specifically, by combining the time series modeling technology of deep learning and the time sequence attention mechanism, the deep correlation between the physiological indicators of live pigs and environmental factors is mined, and the early signal weakening problem caused by ignoring the space-time characteristics in the multi-modal data fusion process of traditional methods is solved. At the same time, by dynamically allocating weights and time-aligning the multi-modal data, the accuracy and efficiency of data fusion are significantly improved, providing more reliable technical support for early warning of the health status of live pigs. BRIEF DESCRIPTION OF DRAWINGS
[0051] Figure 1 A flowchart of the time sequence attention network model construction method for early warning of the diarrhea disease of live pigs in the embodiments of the present application.
[0052] Figure 2 A modular diagram of the standardized data sequence generation process in the embodiments of the present application.
[0053] Figure 3 A logical structure diagram of the time sequence weight labeling and cross-modal correlation analysis in the embodiments of the present application.
[0054] Figure 4 A conversion relationship diagram of the multi-modal feature matrix and the time-aligned feature matrix in the embodiments of the present application.
[0055] Figure 5 A working principle diagram of the health state knowledge graph mapping and the warning item generation in the embodiments of the present application.
[0056] Figure 6 A module composition architecture diagram of the live pig diarrhea disease early warning system in the embodiments of the present application. DETAILED DESCRIPTION
[0057] The application provides a pig diarrhea disease early warning time sequence attention network model construction method and system, and the specific embodiments of the application are described in detail below in combination with the drawings. As shown in Figure 1 The entire method flow includes data preprocessing, feature extraction, time sequence weight labeling, cross-modal correlation analysis, multi-modal feature collection, time sequence alignment, and knowledge graph mapping steps, which are implemented by corresponding modules, specifically involving a data preprocessing module, a feature extraction module, a time sequence weight labeling module, a modal correlation analysis module, a multi-modal feature collection module, a time sequence alignment module, and a knowledge graph mapping module.
[0058] First, the data preprocessing module is responsible for obtaining the physiological index data and environmental factor data of pigs, and preprocessing these raw data to generate standardized data sequences. In actual application, the physiological index data of pigs can be collected in real time through wearable sensors, such as body temperature, heart rate, and feed intake, while the environmental factor data is obtained through environmental monitoring devices deployed in the pig house, such as temperature and humidity, ammonia concentration, and carbon dioxide concentration. These data usually have different dimensions and distribution characteristics, so they need to be normalized. Specifically, the data preprocessing module uses the Z-score standardization method to adjust the mean of each data to 0 and the standard deviation to 1, thereby eliminating the dimensional differences between different data. This process is shown in Figure 2 After the input data is cleaned, missing values are filled, and standardized, the output is a standardized data sequence.
[0059] Next, the feature extraction module calls a deep learning-based time sequence modeling module to extract features from the standardized data sequence and generate an initial feature vector set. In this embodiment, the time sequence modeling module uses long short-term memory network (LSTM) as the core algorithm, which can capture long-term dependencies in time series and is suitable for processing complex dynamic changes in pig physiological indicators and environmental factor data. Specifically, the standardized data sequence is input into the LSTM network, and the network gradually extracts deep features from the data through its internal forget gate, input gate, and output gate mechanisms. Finally, the hidden state of each time step is used as a component of the initial feature vector, forming an initial feature vector set. This process ensures that as much effective information as possible is extracted from the raw data, providing a basis for subsequent analysis.
[0060] The time sequence weight labeling module labels the time sequence weight of each feature vector in the initial feature vector set to determine the time sequence weight set. As shown in Figure 3As shown, the process of time-series weight labeling includes two key steps: timestamp label generation and dynamic weight coefficient calculation. Timestamp labels are used to identify the time point corresponding to each feature vector, in order to perform subsequent time alignment operations. Dynamic weight coefficients are calculated through a self-attention mechanism, which dynamically assigns weights based on the correlation between feature vectors, so that important features occupy a higher proportion in subsequent analysis. Specifically, the self-attention mechanism first calculates the similarity between each feature vector and other feature vectors, and then converts the similarity into weight coefficients through the Softmax function. Finally, the time-series weight set contains timestamp labels and dynamic weight coefficients, providing necessary input for subsequent cross-modal correlation analysis.
[0061] The modal correlation analysis module performs cross-modal time-series correlation analysis based on timestamp labels and dynamic weight coefficients to determine the inter-modal correlation direction and inter-modal correlation strength. As shown, Figure 3 The core of cross-modal correlation analysis is to mine the spatio-temporal correlation between different modal data. Specifically, the inter-modal correlation direction is determined by analyzing the temporal relationship between different modal data, for example, environmental factor data may change before physiological indicator data in time, which reflects the causal relationship between modalities. The inter-modal correlation strength is quantified by calculating the cosine similarity between feature vectors of different modal data, the higher the similarity, the stronger the correlation between the two modal data. This process not only reveals the potential relationship between pig physiological indicators and environmental factors, but also provides guidance for subsequent multi-modal data fusion.
[0062] The multi-modal feature acquisition module is responsible for acquiring multi-modal data features from multiple sensors and generating a multi-modal feature matrix. In practical applications, multi-modal data includes but is not limited to the body temperature, heart rate, feed intake, activity of pigs, and the temperature, humidity, ammonia concentration in the pig house, etc. These data are collected in real time by respective sensors and transmitted to the multi-modal feature acquisition module. The module preliminarily organizes these data according to the timestamp, ensuring that the time series of each modal data is consistent. Subsequently, the multi-modal feature acquisition module concatenates the feature vectors of all modal data into a multi-modal feature matrix, where each row of the matrix represents the data at a time step, and each column represents the features of a modal. This process is shown in Figure 4 As shown, the generation of the multi-modal feature matrix lays the foundation for subsequent time-series alignment operations.
[0063] The time-series alignment module performs time-series alignment on the multi-modal feature matrix based on the inter-modal correlation direction and inter-modal correlation strength to generate an aligned feature matrix. As shown, Figure 4As shown, the core of the time alignment is to solve the time lag problem between different modal data. Specifically, the time alignment module first adjusts the time axis of each modal data according to the inter-modal correlation direction, so that the modal data with strong correlation is aligned in time. For example, if the change of environmental factor data usually leads the physiological indicator data, the time axis of environmental factor data is moved forward by the corresponding time step. Then, the time alignment module weights and fuses the aligned data according to the inter-modal correlation strength, ensuring that the modal data with strong correlation occupies a higher proportion in the fusion process. The finally generated alignment feature matrix not only retains the original information of the multi-modal data, but also eliminates the interference brought by the time lag, providing high-quality input for subsequent health state analysis.
[0064] The knowledge graph mapping module maps the alignment feature matrix with the health state knowledge graph node to generate the early warning item and store it in the database. As shown in Figure 5 As shown, the health state knowledge graph is a structured knowledge representation form, in which the node represents the health state category of the live pig, and the edge represents the correlation between different health states. Specifically, the knowledge graph mapping module first matches each feature vector in the alignment feature matrix with the node in the knowledge graph to find the closest health state category. The matching process calculates the similarity between the feature vector and the node vector using cosine similarity, and the node with the highest similarity is regarded as the health state corresponding to the current feature vector. Subsequently, the knowledge graph mapping module generates the early warning item according to the matching result, and the early warning item includes the live pig number, timestamp, health state category, early warning level and other information. Finally, the early warning item is stored in the database for subsequent query and analysis.
[0065] In terms of system architecture, as shown in Figure 6 As shown, the early warning system for live pig diarrhea disease provided by the present application is composed of a data preprocessing module, a feature extraction module, a time weight labeling module, a modal correlation analysis module, a multi-modal feature acquisition module, a time alignment module and a knowledge graph mapping module. These modules are connected in sequence through data flow, forming a complete data processing and analysis chain. Specifically, the output of the data preprocessing module is used as the input of the feature extraction module, the output of the feature extraction module is used as the input of the time weight labeling module, and so on, and finally the early warning item is generated by the knowledge graph mapping module. In addition, the modules communicate with each other through a unified data interface, ensuring the accuracy and efficiency of data transmission.
[0066] In practical applications, the method and system of the present application can be deployed in the monitoring center of a pig breeding base. By collecting and analyzing the physiological index data and environmental factor data of pigs in real time, potential health risks can be discovered in a timely manner. For example, when the body temperature and activity level of a pig show abnormal fluctuations, and the temperature and humidity and ammonia concentration in the pig house also change significantly, the system will automatically trigger a warning item to remind the management personnel to take appropriate intervention measures. In this way, the present application not only improves the accuracy of early warning of piglet diarrhea disease, but also provides a scientific basis for pig health management.
[0067] Example 1: Early warning application of diarrhea disease in large-scale pig farms. In a large-scale pig farm, an early warning system for diarrhea disease in pigs is constructed by using the method of the present application. By deploying wearable sensors in each pig house, the body temperature, heart rate, and feed intake data of pigs are collected in real time. At the same time, environmental monitoring equipment is installed in the pig house to collect temperature and humidity, ammonia concentration, and carbon dioxide concentration data.
[0068] The collected raw data is cleaned to remove abnormal values caused by sensor failure and missing values caused by pig activity shielding. The Z-score standardization method is used to normalize the cleaned data, so that the mean of each data is 0 and the standard deviation is 1, generating a standardized data sequence.
[0069] The standardized data sequence is input into a long short-term memory network model to extract deep features through the forget gate, input gate, and output gate mechanism. The hidden state of each time step is combined to form an initial feature vector set. The similarity between each feature vector is calculated, and the Softmax function is used to convert it into a dynamic weight coefficient. Each feature vector is assigned a timestamp label to form a time series weight set.
[0070] Based on the timestamp label, the time before and after relationship of different modal data is analyzed to determine the association direction of environmental factors and physiological indicators. The cosine similarity between feature vectors is calculated to determine the association strength. The multiple sensor data is sorted by timestamp and spliced into a multi-modal feature matrix, where each row corresponds to a time step data and each column corresponds to a modal feature.
[0071] According to the association direction, the time axis of each modal data is adjusted to align the strongly associated data in time. Then, the aligned feature matrix is generated by weighted fusion according to the association strength. The aligned feature matrix is matched with the health state knowledge graph nodes stored in the Neo4j graph database. The health state category closest to the cosine similarity is selected to generate an item containing the pig number, timestamp, health state, and warning level, and is stored to realize early warning of diarrhea disease in large-scale farms.
[0072] In the seasonal transition period, the environment of the pig house is prone to large fluctuations, and the piglet diarrhea disease early warning method is applied. The body temperature, heart rate and feed intake data of the piglets are continuously collected by the wearable sensor, and the dynamic changes of the temperature and humidity, ammonia concentration and carbon dioxide concentration in the pig house are recorded in real time by the environmental monitoring equipment.
[0073] The collected data is cleaned, and the abnormal values of temperature and humidity caused by seasonal temperature difference and the physiological index fluctuation values caused by piglet stress are processed. After normalization processing by Z-score standardization method, the standardized data sequence is obtained.
[0074] The standardized data sequence is input into the long short-term memory network, and the deep features of the data in the seasonal transition period are extracted by using the gating mechanism to form an initial feature vector set. The similarity between each feature vector is calculated and converted into a dynamic weight coefficient, and a time sequence weight set is constructed by combining the timestamp label to highlight the feature weight of the environment sudden change period.
[0075] Based on the time sequence weight set analysis mode correlation, the correlation direction of the environmental factor change (such as humidity rise) and the physiological index abnormality (such as body temperature rise) in the seasonal transition period is determined, and the correlation strength between the two is quantified by cosine similarity. The multi-modal data is sorted into a feature matrix according to the timestamp, the time axis is adjusted according to the correlation direction, the environmental data change and the physiological index response are aligned in time, and the aligned feature matrix is generated by weighting according to the correlation strength.
[0076] The aligned feature matrix is matched with the health state knowledge graph in the JanusGraph graph database to accurately identify the early diarrhea signal specific to the seasonal transition period, generate a warning entry and store it in the database, and provide targeted intervention basis for the management personnel.
[0077] In example 3, the piglet diarrhea early weak signal capture application is applied to solve the problem that the early weak signal of piglet diarrhea is easily covered by noise. The physiological index data such as the slight fluctuation of body temperature and the subtle change of feed intake of piglets are collected by high-precision wearable sensors, and the slight fluctuation data of temperature and humidity, ammonia concentration in the pig house are collected synchronously.
[0078] The original data is finely cleaned to retain the weak signal related data and eliminate irrelevant noise. After normalization by Z-score standardization method, the standardized data sequence is generated. The standardized data sequence is input into the long short-term memory network, and the potential rules in the data are deeply mined by the gating mechanism to extract the deep features containing the weak signal and form an initial feature vector set.
[0079] Similarities between the feature vectors are calculated, a higher dynamic weight coefficient is assigned to the weak signal feature through a Softmax function, and a time stamp label is combined to construct a time sequence weight set. Based on the time sequence weight set, the modal correlation is analyzed, the correlation direction of the subtle changes in the environment and the weak physiological signals is determined, the correlation strength is quantified by cosine similarity, and the correlation of the weak signals is strengthened.
[0080] The multi-modal data is sorted into a feature matrix according to the time stamp, the time axis is aligned according to the correlation direction, the weak signals are synchronized in time, and the aligned feature matrix is generated by weighted fusion according to the correlation strength. The aligned feature matrix is matched with the health state knowledge graph node, the health state corresponding to the early weak signal is accurately identified through the cosine similarity, the early warning entry is generated and stored, and the super-early warning of diarrhea disease is realized.
[0081] In the dynamic updating scenario of the health state knowledge graph, the method of the present application is applied to improve the warning accuracy. The physiological indicators and environmental factor data of the live pigs are continuously collected by sensors, including newly added data types such as live pig activity, fecal form, etc., which enrich the data dimensions.
[0082] After the new data and the original data are cleaned together to remove outliers and missing values, the Z-score standardization is used to generate a standardized data sequence. The long short-term memory network is input to extract deep features, and the new data features are included in the initial feature vector set. The similarity between the feature vectors is calculated and converted into a dynamic weight coefficient, and the time stamp label is assigned to form a time sequence weight set to ensure that the new features obtain reasonable weights.
[0083] Based on the time sequence weight set, the correlation direction and strength of the new modal and the original modal are analyzed, and the correlation rules of activity, fecal form, body temperature, and environmental temperature and humidity are determined. The multi-modal data (including new data) is sorted into a feature matrix according to the time stamp, and the time sequence is aligned according to the new correlation direction and strength to generate an aligned feature matrix containing new features.
[0084] The new health state data is regularly updated to the health state knowledge graph of the Neo4j graph database, and the node types and correlation relationships are expanded. The aligned feature matrix is matched with the updated knowledge graph node, the optimal health state category is selected through the cosine similarity, more accurate early warning entries are generated and stored, and efficient early warning under dynamic updating of the knowledge graph is realized.
[0085] The contents not described in detail in the specification are all existing technologies known to those skilled in the art, and the model parameters of each electric appliance are not specifically limited, and conventional equipment can be used. In the technical solution, the electric appliance control elements not mentioned belong to existing technologies, so they are not shown in the figure and will not be described here.
[0086] The above merely describes the preferred embodiments of the present application, and is not used to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for constructing a temporal attention network model for early warning of pig diarrhea, characterized in that: The method comprises the following steps: Obtain the physiological index data and environmental factor data of pigs, and pre-process these raw data to generate standardized data sequences; Call the deep learning-based time series modeling module to extract features from the standardized data sequence and generate an initial feature vector set; Performing time series weight labeling on each feature vector in the initial feature vector set to determine a time series weight set, wherein the time series weight set includes a timestamp label and a dynamic weight coefficient; Perform cross-modal temporal correlation analysis based on timestamp tags and dynamic weight coefficients to determine the direction and strength of inter-modal correlation; Collect multimodal data features from multiple sensors and generate a multimodal feature matrix; Perform temporal alignment on the multimodal feature matrix based on the inter-modal correlation direction and inter-modal correlation strength to generate an aligned feature matrix; Map the alignment feature matrix to the health status knowledge graph nodes, generate warning entries and store them in the database.
2. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: The method of obtaining the physiological index data and environmental factor data of the pigs and preprocessing the raw data to generate a standardized data sequence specifically includes: Wearable sensors collect real-time data on pigs’ body temperature, heart rate, and feed intake; Use environmental monitoring equipment to collect real-time data on temperature, humidity, ammonia concentration, and carbon dioxide concentration in the pig house; Clean the collected data to remove outliers and missing values; The Z-score standardization method was used to normalize the cleaned data so that the mean of each data was adjusted to zero and the standard deviation was adjusted to one.
3. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: The calling of the deep learning-based time series modeling module to extract features from the standardized data sequence and generate an initial feature vector set specifically includes: Input the standardized data sequence into the long short-term memory network model; Extract deep features from standardized data sequences through forget gate, input gate, and output gate mechanisms; The hidden state of each time step is used as a component of the initial feature vector to form an initial feature vector set.
4. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: The step of respectively labeling each feature vector in the initial feature vector set with a time series weight to determine the time series weight set specifically includes: Calculate the similarity between each eigenvector and other eigenvectors; The similarity is converted into a dynamic weight coefficient through the Softmax function; A timestamp label is assigned to each feature vector to form a temporal weight set including the timestamp label and the dynamic weight coefficient.
5. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: The cross-modal temporal correlation analysis based on the timestamp label and the dynamic weight coefficient is performed to determine the inter-modal correlation direction and inter-modal correlation strength, specifically including: Calculate the relationship between different modal data on the time axis and determine the correlation direction between modalities; Calculate the cosine similarity between the feature vectors of different modal data to determine the correlation strength between the modalities.
6. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: The method of collecting multimodal data features from multiple sensors and generating a multimodal feature matrix specifically includes: Arrange the data collected by various sensors according to timestamps to ensure the consistency of the time series of each modality data; The eigenvectors of each modal data are concatenated into a multimodal feature matrix, where each row of the matrix corresponds to the data of a time step and each column corresponds to the features of a modality.
7. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: The temporal alignment of the multimodal feature matrix based on the inter-modal correlation direction and the inter-modal correlation strength to generate the aligned feature matrix specifically includes: Adjust the time axis of each modal data according to the correlation direction between the modalities so that the modal data with strong correlation are aligned in time; The aligned data are weightedly fused according to the correlation strength between the modalities to generate an alignment feature matrix.
8. The method for constructing a temporal attention network model for early warning of pig diarrhea according to claim 1, characterized in that: Mapping the alignment feature matrix with the health status knowledge graph nodes, generating warning items and storing them in the database specifically includes: Match each feature vector in the aligned feature matrix with a node in the health status knowledge graph; The cosine similarity is used to calculate the similarity between the feature vector and the node vector, and the node with the highest similarity is selected as the health status category corresponding to the current feature vector; Generate an early warning entry containing the pig number, timestamp, health status category and early warning level, and store it in the database.
9. The method for constructing a temporal attention network model for early warning of swine diarrhea according to any one of claims 1 to 8, characterized in that: The health status knowledge graph is stored and managed using a graph database, which includes Neo4j or JanusGraph.
10. A temporal attention network model construction system for early warning of swine diarrhea, used to execute the temporal attention network model construction method for early warning of swine diarrhea according to any one of claims 1 to 9, characterized in that: The system comprises: A data preprocessing module is used to obtain physiological indicator data and environmental factor data of pigs, and preprocess these raw data to generate standardized data sequences; A feature extraction module is used to call a deep learning-based time series modeling module to extract features from the standardized data sequence and generate an initial feature vector set; A timing weight labeling module, wherein the timing weight labeling module is used to label each feature vector in the initial feature vector set with a timing weight to determine a timing weight set; A modal correlation analysis module, which is used to perform cross-modal temporal correlation analysis based on timestamp tags and dynamic weight coefficients to determine the direction and strength of inter-modal correlation; A multimodal feature acquisition module, which is used to collect multimodal data features from multiple sensors and generate a multimodal feature matrix; A timing alignment module, configured to perform timing alignment on a multimodal feature matrix based on an inter-modal correlation direction and an inter-modal correlation strength to generate an aligned feature matrix; The knowledge graph mapping module is used to map the alignment feature matrix with the health status knowledge graph nodes, generate warning entries and store them in the database.
Citation Information
Patent Citations
Pig behavior and health method based on deep learning and physiological parameter dynamic monitoring
CN118986303A
Livestock breeding state monitoring method and system
CN119558336A
Pig breeding intelligent management and control system based on multi-modal data monitoring
CN120338722A
Chronic disease early detection method and system based on multi-mode large model
CN120388733A
Jinhua pork quality improvement method and system based on data mining
CN120634041A