Breeding livestock posture recognition method, device and system and medium
By collecting and processing livestock movement data, using cross-attention processing and convolutional processing of azimuth and L2 norm features, combined with behavior classification prediction model, the problem of inability to track livestock posture in the existing technology is solved, efficient and robust health monitoring is achieved, and breeding benefits are improved.
Patent Information
- Application Number
- CN202510343474.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-03-21
AI Technical Summary
The existing breeding livestock monitoring system cannot track individual postures in real time and continuously, resulting in the inability to detect health problems in a timely manner, and the environmental interference is sensitive, affecting economic benefits.
By collecting livestock movement data, it is converted into azimuth characteristics and L2 norm characteristics, combined with attention cross-processing and convolution processing, the trained behavior classification prediction model is input to achieve high-precision pose recognition, reduce manual intervention, and adapt to complex environments.
Real-time and continuous tracking of livestock postures is achieved, the frequency of manual patrols is reduced, the micro-physiological changes are identified, the efficiency and economic benefits of health monitoring are improved, and environmentally robust.
Smart Images

Figure CN120492993A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method, device, system and medium for recognizing the posture of farmed livestock, and belongs to the technical field of posture recognition. Background Art
[0002] The livestock farming industry is currently experiencing rapid growth, and the implementation of real-time monitoring systems is crucial for its development. Numerous achievements have been made in the field of animal monitoring, such as the Encounternet project at the University of Colorado and the BATS project, funded by the German Research Foundation. These projects have achieved a weight limit of 1-2g for mobile sensing nodes used to monitor small birds and bats. However, current industry developments lack the ability to perform posture recognition on livestock. Instead, cameras are often used to capture livestock activity or rely on RFID ear tags and anklets to track individual animals. However, cameras are unable to track the specific and continuous state of an individual, and they can only monitor a specific area of livestock activity, resulting in a narrow monitoring range and potential loss of detection if the animal wanders out of view. RFID ear tags and anklets, on the other hand, can only track the individual's location, but cannot determine their behavior or condition. This can lead to individuals missing timely medical treatment and attention, further impacting the livestock industry. Therefore, we aim to design a livestock health monitoring and identification system capable of real-time monitoring and tracking. Summary of the Invention
[0003] The purpose of the present invention is to provide a method, device, system and medium for livestock posture recognition, which can achieve the purpose of real-time monitoring and tracking of livestock by combining livestock posture data with recognition processing of network models.
[0004] In order to achieve the above objectives / solve the above technical problems, the present invention is implemented by adopting the following technical solutions.
[0005] In one aspect, the present invention provides a method for identifying the posture of farmed livestock, comprising the following steps:
[0006] Collect livestock movement data in real time;
[0007] Convert the motion data into azimuth features, obtain the L2 norm features of the azimuth features, and calculate the root mean square value features of the L2 norm;
[0008] The azimuth feature, the L2 norm feature of the azimuth feature, and the root mean square value feature of the calculated L2 norm are input into the trained behavior classification prediction model in parallel to obtain the livestock posture behavior results;
[0009] The processing of the trained behavior classification prediction model includes:
[0010] The azimuth feature and the L2 norm feature of the azimuth feature are spliced in the feature dimension to obtain the first feature, and the first feature is convolved several times to obtain the convolution feature. The azimuth feature and the L2 norm feature are combined during the splicing process to enrich the input features. The convolution process extracts local temporal patterns, identifies short-term posture changes, and improves the accuracy of behavior recognition.
[0011] The azimuth feature and the root mean square value feature of the L2 norm are cross-processed to obtain the azimuth attention feature and the root mean square value attention feature of the L2 norm; the important features are given higher weights through the attention mechanism to increase the attention to key postures, and the azimuth feature and the root mean square value feature are combined to enhance the posture pattern recognition ability.
[0012] The azimuth attention feature and the L2 norm root mean square value attention feature are respectively multiplied point by point with the convolution feature to obtain the azimuth enhanced feature and the L2 norm root mean square value enhanced feature, which facilitates the enhanced feature interaction and has high information fusion capability;
[0013] The azimuth enhanced features and the L2 norm root mean square value enhanced features are cascaded to obtain preliminary fusion features. The cascade operation combines different feature sources to enhance the feature discrimination ability, allowing the posture information and stability information to interact with each other and improve the performance of the model.
[0014] Perform global modeling operations on the preliminary fusion features to obtain global fusion features. The global modeling operation allows the model to improve its understanding of complex behaviors.
[0015] The global fusion features and the first features are organized into a sequence input LSTM network according to time steps to capture the dependencies in the sequence, and classified through the fully connected layer to obtain the livestock posture behavior results, which improves the model's time series modeling ability and generalization ability, making the prediction more accurate.
[0016] Furthermore, the motion data is converted into azimuth data, specifically including:
[0017] The motion data includes: acceleration data and rotation speed of the livestock in the X, Y, and Z directions; the azimuth angle data includes pitch angle data, roll angle data, and yaw angle data;
[0018] Based on the acceleration data of the livestock in the X, Y, and Z directions, the pitch angle and roll angle are calculated using the following expressions:
[0019] Pitch = ;
[0020] Roll = ;
[0021] Among them: Ax is the acceleration of the livestock in the X direction, A y is the acceleration of the livestock in the Y direction, A z is the acceleration of the livestock in the Z direction, Pitch is the pitch angle data of the livestock, and Roll is the roll angle data of the livestock.
[0022] The yaw angle is calculated based on the rotation speed of the livestock in the X, Y, and Z directions. The expression is:
[0023] = + ;
[0024] in: Initialized to 0, is the yaw angle data at time t, is the rotation speed of the livestock in the Z direction, is the sampling time interval.
[0025] Furthermore, the azimuth feature and the L2 norm root mean square value feature are subjected to attention cross processing to obtain the azimuth attention feature and the L2 norm root mean square value attention feature, specifically including:
[0026] Perform cross-attention processing on the azimuth feature with the key vector and the value vector, and the L2 norm root mean square value feature with the query vector to obtain the azimuth enhanced feature K;
[0027] The L2 norm root mean square value feature is processed with the key vector and value vector and the azimuth enhanced feature K is processed with the query vector to obtain the L2 norm root mean square value enhanced feature H;
[0028] The azimuth enhanced feature K and the L2 norm root mean square value enhanced feature H are processed by self-attention respectively to obtain the azimuth attention feature L and the L2 norm root mean square value attention feature I respectively;
[0029] Furthermore, the first feature is subjected to several convolution processes to obtain a convolution feature, specifically including:
[0030] The first feature A is subjected to three 1×1 convolution processes in sequence to obtain the convolution feature D.
[0031] Furthermore, the training method of the behavior classification prediction model specifically includes:
[0032] Collect livestock movement data and image data;
[0033] The livestock's motion data and image data are stored in a time stamp order, and the livestock's image data is labeled with behavior categories;
[0034] Establish a dataset based on image data with behavior category annotations and motion data at corresponding times;
[0035] Preprocess the dataset;
[0036] The preprocessed dataset is divided into a training set and a validation set in a ratio of 8:2 and input into the behavior classification prediction model for training;
[0037] Among them, the training set data of the dataset is loaded in batches during the training process;
[0038] Move the training set data to the GPU / CPU, forward propagate, obtain prediction results, calculate loss values, backpropagate, calculate gradients, and update model weights;
[0039] Record training loss and accuracy;
[0040] When the loss value of the validation set stops decreasing within several consecutive epochs, the training is stopped to obtain the trained behavior classification prediction model.
[0041] In a second aspect, the present invention provides a method and device for identifying the posture of farmed livestock, comprising:
[0042] Collection module: used for collecting livestock movement data in real time;
[0043] The preprocessing module is used to convert the motion data into azimuth features, obtain the L2 norm features of the azimuth features, and calculate the root mean square value features of the L2 norm;
[0044] A detection module is used to input the azimuth feature, the L2 norm feature of the azimuth feature, and the root mean square value feature of the calculated L2 norm into the trained behavior classification prediction model in parallel to obtain the livestock posture behavior results;
[0045] The processing of the trained behavior classification prediction model includes:
[0046] The azimuth feature and the L2 norm feature of the azimuth feature are concatenated in the feature dimension to obtain the first feature, and the first feature is convolved several times to obtain the convolution feature;
[0047] Perform attention cross processing on the azimuth feature and the L2 norm root mean square value feature to obtain the azimuth attention feature and the L2 norm root mean square value attention feature;
[0048] The azimuth attention feature and the L2 norm root mean square value attention feature are respectively multiplied point by point with the convolution feature to obtain the azimuth enhanced feature and the L2 norm root mean square value enhanced feature;
[0049] The azimuth enhanced feature and the L2 norm root mean square value enhanced feature are cascaded to obtain the preliminary fusion feature;
[0050] Perform global modeling operations on the preliminary fusion features to obtain global fusion features;
[0051] The global fusion features and the first features are organized into a sequence by time step and input into the LSTM network to capture the dependencies in the sequence, and are classified through the fully connected layer to obtain the livestock posture behavior results.
[0052] In a third aspect, the present invention provides a livestock posture recognition system, comprising:
[0053] Memory, used to store computer programs / instructions;
[0054] A processor is used to execute the computer program / instructions to implement the steps of the above-mentioned livestock posture recognition method.
[0055] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the above-mentioned livestock posture recognition method.
[0056] In a fifth aspect, the present invention provides a computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned livestock posture recognition method.
[0057] Compared with the prior art, the present invention has the following beneficial effects:
[0058] Compared with traditional cameras, the present invention can break through the time and space limitations of camera shooting to achieve real-time and continuous tracking of individual livestock without human intervention; the present invention conducts corresponding analysis based on high-precision livestock posture data of azimuth data to realize an automated monitoring system, reduce the frequency of manual inspections or observations of livestock, and efficiently extract and analyze complex posture features based on trained behavior classification prediction models, identify subtle changes in physiological state, and facilitate early detection of potential health problems; and the present invention assists farmers in taking targeted measures by timely monitoring the special physiological state of livestock, thereby improving breeding output and economic benefits; compared with traditional methods, the present invention has strong robustness to environmental interference such as light, background, and weather, can still operate stably in complex breeding environments, and has strong environmental adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 Flowchart of a livestock posture recognition method based on deep learning in an example of the present invention;
[0060] Figure 2It is a hierarchical structure diagram of the behavior prediction classification model in the invention example. DETAILED DESCRIPTION
[0061] It should be noted that:
[0062] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0063] The term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Additionally, the character " / " generally indicates an "or" relationship between the related objects.
[0064] Example 1
[0065] The present invention provides a method for identifying the posture of livestock, comprising the following steps:
[0066] Step 1: Collect livestock movement data in real time, including:
[0067] The MPU6050 sensor worn by livestock continuously measures the livestock's rotation speed (motion data) on the X, Y, and Z axes through the MPU6050 sensor's built-in three-axis gyroscope. The unit of measurement is ° / s.
[0068] Depending on the livestock, sensors can be installed on the neck or back of cattle, or on the back or ears of pigs.
[0069] Step 2: Convert the motion data into azimuth features, obtain the L2 norm features of the azimuth features, and calculate the root mean square value features of the L2 norm, including:
[0070] Step 2.1: The motion data includes: acceleration data and rotational speed of the livestock in the X, Y, and Z directions; the azimuth angle data includes pitch angle data, roll angle data, and yaw angle data;
[0071] Based on the acceleration data of the livestock in the X, Y, and Z directions, the pitch angle and roll angle are calculated using the following expressions:
[0072] Pitch = ;
[0073] Roll = ;
[0074] Among them: Ax is the acceleration of the livestock in the X direction, A y is the acceleration of the livestock in the Y direction, A z is the acceleration of the livestock in the Z direction, Pitch is the pitch angle data of the livestock, and Roll is the roll angle data of the livestock.
[0075] The yaw angle is calculated based on the rotation speed of the livestock in the X, Y, and Z directions. The expression is:
[0076] = + ;
[0077] in: Initialized to 0, is the yaw angle data at time t, is the rotation speed of the livestock in the Z direction, is the sampling time interval.
[0078] Step 2.2: The method for obtaining the L2 norm feature of the azimuth feature includes:
[0079] = ;
[0080] in: is the L2 norm feature of the azimuth feature at time t, is the pitch angle data of livestock at time t; The rolling angle data of livestock at time t; is time t;
[0081] Step 2.3: The method for calculating the root mean square value feature of the L2 norm includes:
[0082] RMS = ;
[0083] Where: N is the number of L2 norm features of the azimuth feature.
[0084] Step 3: Input the azimuth feature, the L2 norm feature of the azimuth feature, and the root mean square value feature of the calculated L2 norm into the trained behavior classification prediction model in parallel to obtain the livestock posture behavior results;
[0085] The processing of the trained behavior classification prediction model includes:
[0086] Step 3.1: Concatenate the azimuth feature and the L2 norm feature of the azimuth feature to obtain the first feature, and perform several convolution operations on the first feature to obtain the convolution feature, specifically including:
[0087] The azimuth feature X and the L2 norm feature Y of the azimuth feature are connected to obtain the first feature A, and then the first feature A is passed through a 1×1 convolution layer to obtain the second feature B, and then the second feature B is passed through a 1×1 convolution layer to obtain the third feature C, and then the third feature C is passed through a 1×1 convolution layer to obtain the convolution feature D;
[0088] Step 3.2: Perform attention cross processing on the azimuth feature and the L2 norm root mean square value feature to obtain the azimuth attention feature and the L2 norm root mean square value attention feature, specifically including:
[0089] The azimuth feature X is processed with the key vector and the value vector, and the L2 norm root mean square value feature Z is processed with the query vector to obtain the azimuth enhanced feature K;
[0090] The L2 norm root mean square value feature Z is processed with the key vector and value vector, and the azimuth enhanced feature K is processed with the query vector to obtain the L2 norm root mean square value enhanced feature H;
[0091] The azimuth enhanced feature K and the L2 norm root mean square value enhanced feature H are self-attention processed respectively to obtain the azimuth attention feature L and the L2 norm root mean square value attention feature I respectively.
[0092] Step 3.3: Multiply the azimuth attention feature L and the L2 norm root mean square value attention feature I by the convolution feature D point by point to obtain the azimuth enhanced feature S and the L2 norm root mean square value enhanced feature J.
[0093] Step 3.4: Cascade the azimuth enhanced feature S and the L2 norm root mean square value enhanced feature J to obtain the preliminary fusion feature E.
[0094] Step 3.5: Perform global modeling operations on the preliminary fusion feature E to obtain the global fusion feature F;
[0095] Step 3.6: Organize the global fusion feature F and the first feature A into a sequence by time step, input the LSTM network to capture the dependencies in the sequence, and output the classification feature G, which is then classified through the fully connected layer to obtain the livestock posture behavior result M.
[0096] The training method of the behavior classification prediction model specifically includes:
[0097] Collect livestock movement data and image data;
[0098] The livestock's motion data and image data are stored in a time stamp order, and the livestock's image data is labeled with behavior categories;
[0099] Establish a dataset based on image data with behavior category annotations and motion data at corresponding times;
[0100] Preprocess the dataset;
[0101] The preprocessed dataset is divided into a training set and a validation set in a ratio of 8:2 and input into the behavior classification prediction model for training;
[0102] Among them, the training set data of the dataset is loaded in batches during the training process;
[0103] Move the training set data to the GPU / CPU, forward propagate, obtain prediction results, calculate loss values, backpropagate, calculate gradients, and update model weights;
[0104] Record training loss and accuracy;
[0105] When the loss value of the validation set stops decreasing within several consecutive epochs, the training is stopped to obtain the trained behavior classification prediction model.
[0106] Use the validation set to test the trained behavior classification prediction model and calculate the classification accuracy of the model;
[0107] Calculate the confusion matrix, analyze the classification results of each behavior category, and obtain the precision rate, call rate and F1-score evaluation indicators;
[0108] The trained model is optimized, and the optimized behavior classification prediction model is used to perform behavior classification prediction on the real-time motion data and image data of livestock, and the livestock posture behavior category results are output; the optimized model is the final behavior classification prediction model.
[0109] To avoid overfitting of the model and save computing resources, we can introduce early stopping. By monitoring the loss value of the validation set, we stop training when the loss value of the validation set stops decreasing within several consecutive epochs.
[0110] The threshold is set to 5 consecutive epochs. If the validation set loss does not improve within these 5 epochs, the model training is considered to have stabilized and training is stopped. Early stopping can prevent the training time from being too long and reduce the risk of model overfitting.
[0111] Example 2
[0112] This embodiment provides a method and apparatus for identifying the posture of farmed livestock, including:
[0113] Collection module: used for collecting livestock movement data in real time;
[0114] The preprocessing module is used to convert the motion data into azimuth features, obtain the L2 norm features of the azimuth features, and calculate the root mean square value features of the L2 norm;
[0115] A detection module is used to input the azimuth feature, the L2 norm feature of the azimuth feature, and the root mean square value feature of the calculated L2 norm into the trained behavior classification prediction model in parallel to obtain the livestock posture behavior results;
[0116] The processing of the trained behavior classification prediction model includes:
[0117] The azimuth feature and the L2 norm feature of the azimuth feature are concatenated to obtain the first feature, and the first feature is convolved several times to obtain the convolution feature;
[0118] Perform attention cross processing on the azimuth feature and the L2 norm root mean square value feature to obtain the azimuth attention feature and the L2 norm root mean square value attention feature;
[0119] The azimuth attention feature and the L2 norm root mean square value attention feature are respectively multiplied point by point with the convolution feature to obtain the azimuth enhanced feature and the L2 norm root mean square value enhanced feature;
[0120] The azimuth enhanced feature and the L2 norm root mean square value enhanced feature are cascaded to obtain the preliminary fusion feature;
[0121] Perform global modeling operations on the preliminary fusion features to obtain global fusion features;
[0122] The global fusion features and the first features are organized into a sequence by time step and input into the LSTM network to capture the dependencies in the sequence, and are classified through the fully connected layer to obtain the livestock posture behavior results.
[0123] Example 3
[0124] This embodiment provides a livestock posture recognition system, including:
[0125] Memory, used to store computer programs / instructions;
[0126] A processor is used to execute the computer program / instructions to implement the steps of the above-mentioned livestock posture recognition method.
[0127] Example 4
[0128] This embodiment provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the above-mentioned livestock posture recognition method are implemented.
[0129] Example 5
[0130] This embodiment provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned livestock posture recognition method when executed by a processor.
[0131] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0135] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which are all protected by the present invention.
Claims
1. A method for identifying the posture of livestock, characterized in that: The following steps are involved: Collect livestock movement data in real time; Convert the motion data into azimuth features, obtain the L2 norm features of the azimuth features, and calculate the root mean square value features of the L2 norm; The azimuth feature, the L2 norm feature of the azimuth feature, and the calculated L2 norm root mean square value feature are input into the trained behavior classification prediction model in parallel to obtain the livestock posture behavior results; The processing of the trained behavior classification prediction model includes: The azimuth feature and the L2 norm feature of the azimuth feature are concatenated in the feature dimension to obtain the first feature, and the first feature is convolved several times to obtain the convolution feature; Perform attention cross processing on the azimuth feature and the L2 norm root mean square value feature to obtain the azimuth attention feature and the L2 norm root mean square value attention feature; The azimuth attention feature and the L2 norm root mean square value attention feature are respectively multiplied point by point with the convolution feature to obtain the azimuth enhanced feature and the L2 norm root mean square value enhanced feature; The azimuth enhanced feature and the L2 norm root mean square value enhanced feature are cascaded to obtain the preliminary fusion feature; Perform global modeling operations on the preliminary fusion features to obtain global fusion features; The global fusion features and the first features are organized into a sequence by time step and input into the LSTM network to capture the dependencies in the sequence, and are classified through the fully connected layer to obtain the livestock posture behavior results.
2. The livestock posture recognition method according to claim 1, characterized in that: The motion data is converted into azimuth data, specifically including: The motion data includes: acceleration data and rotation speed of the livestock in the X, Y, and Z directions; the azimuth angle data includes pitch angle data, roll angle data, and yaw angle data; Based on the acceleration data of the livestock in the X, Y, and Z directions, the pitch angle and roll angle are calculated using the following expressions: Pitch = ; Roll = ; Among them: A x is the acceleration of the livestock in the X direction, A y is the acceleration of the livestock in the Y direction, A z is the acceleration of the livestock in the Z direction, Pitch is the pitch angle data of the livestock, and Roll is the roll angle data of the livestock.
3. Calculate the yaw angle based on the animal's rotation speed in the X, Y, and Z directions. The expression is: = + ; in: Initialized to 0, is the yaw angle data at time t, is the rotation speed of the livestock in the Z direction, is the sampling time interval.
4. The livestock posture recognition method according to claim 1, characterized in that: The cross-attention processing of the azimuth feature and the L2 norm root mean square value feature to obtain the azimuth attention feature and the L2 norm root mean square value attention feature specifically includes: Perform cross-attention processing on the azimuth feature with the key vector and the value vector, and the L2 norm root mean square value feature with the query vector to obtain the azimuth enhanced feature K; The L2 norm root mean square value feature is processed with the key vector and value vector and the azimuth enhanced feature K is processed with the query vector to obtain the L2 norm root mean square value enhanced feature H; The azimuth enhanced feature K and the L2 norm root mean square value enhanced feature H are self-attention processed respectively to obtain the azimuth attention feature L and the L2 norm root mean square value attention feature I respectively.
5. The livestock posture recognition method according to claim 1, characterized in that: The first feature is subjected to several convolution processes to obtain the convolution feature, specifically including: The first feature A is subjected to three 1×1 convolution processes in sequence to obtain the convolution feature D.
6. The livestock posture recognition method according to claim 1, characterized in that: The training method of the behavior classification prediction model specifically includes: Collect livestock movement data and image data; The livestock's motion data and image data are stored in a time stamp order, and the livestock's image data is labeled with behavior categories; Establish a dataset based on image data with behavior category annotations and motion data at corresponding times; Preprocess the dataset; The preprocessed dataset is divided into a training set and a validation set in a ratio of 8:2 and input into the behavior classification prediction model for training; Among them, the training set data of the dataset is loaded in batches during the training process; Move the training set data to the GPU / CPU, forward propagate, obtain prediction results, calculate loss values, backpropagate, calculate gradients, and update model weights; Record training loss and accuracy; When the loss value of the validation set stops decreasing within several consecutive epochs, the training is stopped to obtain the trained behavior classification prediction model.
7. A method and device for identifying the posture of farmed livestock, characterized in that: include: Collection module: used for collecting livestock movement data in real time; The preprocessing module is used to convert the motion data into azimuth features, obtain the L2 norm features of the azimuth features, and calculate the root mean square value features of the L2 norm; A detection module is used to input the azimuth feature, the L2 norm feature of the azimuth feature, and the root mean square value feature of the calculated L2 norm into the trained behavior classification prediction model in parallel to obtain the livestock posture behavior results; The processing of the trained behavior classification prediction model includes: The azimuth feature and the L2 norm feature of the azimuth feature are concatenated in the feature dimension to obtain the first feature, and the first feature is convolved several times to obtain the convolution feature; Perform attention cross processing on the azimuth feature and the L2 norm root mean square value feature to obtain the azimuth attention feature and the L2 norm root mean square value attention feature; The azimuth attention feature and the L2 norm root mean square value attention feature are respectively multiplied point by point with the convolution feature to obtain the azimuth enhanced feature and the L2 norm root mean square value enhanced feature; The azimuth enhanced feature and the L2 norm root mean square value enhanced feature are cascaded to obtain the preliminary fusion feature; Perform global modeling operations on the preliminary fusion features to obtain global fusion features; The global fusion features and the first features are organized into a sequence by time step and input into the LSTM network to capture the dependencies in the sequence, and are classified through the fully connected layer to obtain the livestock posture behavior results.
8. A livestock posture recognition system, characterized in that: include: Memory, used to store computer programs / instructions; A processor, configured to execute the computer program / instructions to implement the steps of the livestock posture recognition method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the livestock posture recognition method described in any one of claims 1 to 5 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the livestock posture recognition method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Target recognition method
CN104463245A
SAR image target recognition method based on adaptive multi-azimuth dictionary pair learning
CN110781822A
Refined path loss prediction method for bimodal network correction
CN116318462A
Communication, sensing and control integration method in industrial Internet of Things
CN117240342A
Livestock health detection and evaluation method for livestock farm based on double optical cameras
CN117882655A
Cited By
Wearable livestock device and daily behavior monitoring method
CN121524812A