A sheep behavior feature recognition method and system
Through video and biological signal data processing, combined with multi-layer learning classification models, the accurate identification of sheep behavior characteristics is achieved, the problem of difficulty in artificial identification in large-scale breeding is solved, and the economic benefits of the farm and sheep health monitoring capabilities are improved.
Patent Information
- Application Number
- CN202410398556.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-03
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-04-03
AI Technical Summary
In large-scale sheep breeding, it is difficult to manually identify the behavioral characteristics of sheep, resulting in untimely monitoring of emergencies, reducing breeding benefits and economic benefits.
The video recording information and multi-dimensional biological signal data of sheep behavior characteristics are obtained through the video surveillance device, the input matrix is constructed, and the multi-layer learning classification model of weight cross-fusion operation and hierarchical feature extraction is used for identification, and the recognition results are outputted in combination with the hierarchical function.
It realizes accurate identification of sheep behavioral characteristics, monitors health status and biological rhythms, and improves the economic benefits of the farm and sheep production potential.
Smart Images

Figure CN118296552B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of precision and intelligent breeding technology, and in particular to a method and system for identifying sheep behavioral characteristics. Background Art
[0002] In recent years, with the rapid advancement of science and technology, the sheep farming industry has developed towards intensification, scale, and intelligent operations. Farming operations of a certain scale often employ tens of thousands of sheep. Furthermore, identifying sheep behavioral characteristics can provide a better understanding of their well-being, allowing for accurate assessment of their health and circadian rhythms. By identifying and monitoring sheep's behavioral characteristics, such as feeding, movement, and resting, it is possible to optimize feeding management, improve efficiency, and reduce energy and feed waste, thereby avoiding unnecessary economic losses for farming operations and ensuring efficient ecological and economic operations. Currently, the identification of sheep behavioral characteristics relies primarily on manual identification. However, in large-scale farming operations, accurate identification of sheep behavioral characteristics through manual identification alone is extremely difficult, and many emergencies often go undetected, significantly reducing sheep welfare, efficiency, and the economic benefits of the farm.
[0003] Sheep exhibit different behavioral characteristics during the breeding process, including but not limited to feeding, rumination, standing, moving, and resting. Different behavioral characteristics represent different physiological meanings. In summary, analyzing these behavioral characteristics will help breeders clearly understand the health status and biological rhythms of their sheep, thereby better realizing the sheep's production potential and improving the economic benefits of the farm. Summary of the Invention
[0004] In order to overcome the shortcomings of the existing technology, the purpose of the present invention is to provide a method and system for identifying sheep behavioral characteristics, which can identify sheep behavioral characteristics through multi-dimensional biological signal data of sheep and video recording information of sheep behavioral characteristics, further monitor the health status and biological rhythm of sheep, so as to better realize the production potential of sheep and improve the economic benefits of farms.
[0005] To achieve the above object, the present invention provides the following solution: a method for identifying sheep behavior characteristics, comprising the following steps:
[0006] S1. Obtain video recording information of sheep behavioral characteristics through video monitoring equipment, process the video recording information, and construct a behavioral characteristic image data input matrix;
[0007] S2. Acquire multi-dimensional biological signal data of the sheep's behavioral characteristics, process the multi-dimensional biological signal data, and construct a multi-dimensional biological signal characteristic value input matrix of the sheep's behavioral characteristics;
[0008] S3, a multi-layer learning classification model based on weighted cross-fusion operation and hierarchical feature extraction, and a preset sheep behavior feature recognition model;
[0009] S4. Inputting the behavioral characteristic image data input matrix and the multi-dimensional biological signal characteristic value input matrix into a preset sheep behavioral characteristic recognition model for training, verification, and testing. Adjusting the weight matrix and variable parameters based on the verification results, and evaluating the model based on the test results to ultimately obtain a sheep behavioral characteristic recognition model.
[0010] S5. Apply the sheep behavior feature recognition model to real-world scenarios, construct a matrix of behavior feature image data to be recognized and a matrix of multi-dimensional biological signal feature values to be recognized, and combine the classification function to construct a classification input matrix;
[0011] S6. Input the obtained hierarchical input matrix into the sheep behavior feature recognition model, and output the corresponding sheep behavior feature results to complete the sheep behavior feature recognition.
[0012] Preferably, in step S1, the processing of the video recording information includes: performing frame extraction processing on the video recording information of the sheep behavior characteristics to obtain image data, and marking the sheep behavior characteristic category and sheep identification number in the image data, and then performing grayscale processing, image enhancement and coding serialization on the marked image data to construct a behavior characteristic image data input matrix;
[0013] Performing frame extraction processing on the video recording information of the sheep behavior characteristics: cropping and selecting the obtained video recording information of the sheep behavior characteristics to obtain high-definition video clips, and returning the video recording information of the sheep behavior characteristics; dividing the video recording information of the sheep behavior characteristics according to the frames constituting the video, and extracting image information from each frame of the video and saving it as separate image data;
[0014] The formula for the grayscale processing is:
[0015]
[0016] Among them, P ij Represents the grayscale value of the pixel in the i-th row and j-th column; R ij , G ij 、B ij Represent the pixel values of the three channels of the pixel point in the i-th row and j-th column respectively;
[0017] The image data enhancement is to transform and process the original image by applying mirror flipping, random rotation, random cropping, color transformation, noise addition, translation transformation, scale transformation and deformation transformation;
[0018] The coding serialization is as follows: encoding the pixels in the image and then arranging the encoded pixels into sequence data;
[0019] The formula for encoding serialization is:
[0020] S ij =f ASCII (P ij )×f Unicode (P ij )=int(P ij ×(K-1) / 255)×int(P ij ×(L-1) / 255),i,j=1,2,…,n;
[0021]
[0022] Among them, Si j Represents the element in row i and column j of the sequence data; f ASCII () represents the ASCII encoding function, which converts the pixel gray value into the corresponding ASCII encoding value; f Unicode () represents the Unicode encoding function, which converts the pixel grayscale value into the corresponding Unicode code value; K represents the length of the ASCII character set; L represents the length of the Unicode character set; S represents the image data input sub-matrix after encoding serialization; T represents transposition; Represents the image data input sub-vector arranged in row-major or column-major manner; represents the image data acquired from the start time t0 to the end time t; t0 represents the start time of data acquisition; t represents the end time of data acquisition;
[0023] The image data input sub-matrices after grayscale processing, image enhancement and encoding serialization are stacked to construct the behavioral feature image data input matrix.
[0024] Preferably, in step S2, after obtaining the multi-dimensional bio-signal data, the multi-dimensional bio-signal data needs to be pre-processed, including removing abnormal multi-dimensional bio-signal data points in the multi-dimensional bio-signal data and compensating for missing multi-dimensional bio-signal data points in the multi-dimensional bio-signal data;
[0025] Assume that three different biosignal data are obtained, denoted as x, y, and z respectively. The formula for determining abnormal data points in the multi-dimensional biosignal data is:
[0026]
[0027] Among them, P * (x i ,y i ,z i ) represents a multi-dimensional biological signal data point in the multi-dimensional biological signal data; P(x i ,y i ,z i ) represents any multi-dimensional biological signal data point in the sheep multi-dimensional biological signal data; d k (P * (x i ,y i ,z i ),P(x i ,y i ,z i )) represents the distance between two multi-dimensional biological signal data, N k (P * (x i ,y i ,z i )) represents the multi-dimensional biological signal data points in P * (x i ,y i ,z i ) is the center of the circle, k is the area formed by the radius; k is a constant;
[0028] Compensating for missing data points in the multi-dimensional biosignal data is performed, specifically:
[0029] Determine the multi-dimensional biological signal data that is similar to the required compensation data point. The similarity measurement formula is:
[0030]
[0031] in, Represents the similarity metric of two multi-dimensional biological signal data, represents the mean;
[0032] Through the similarity measurement formula, similar multi-dimensional biological signal data is obtained, and the compensation value prediction calculation is performed on it. The formula is as follows:
[0033]
[0034] Among them, μ represents the expected value of the total parameter of compensation prediction weight; Represents similar multi-dimensional biological signal data obtained by similarity measurement calculation; Represents the homogeneous weight parameter of the i-th vector parameter; Represents the parameter dimension of the i-th vector parameter; Represents the correction constant.
[0035] Preferably, in step S2, the processing of the multi-dimensional biosignal data includes:
[0036] Behavior labeling and identity number labeling: The obtained multi-dimensional bio-signal data is classified in combination with the video recording information of the sheep's behavioral characteristics, and the behavioral characteristic categories and sheep's identity numbers of the classified multi-dimensional bio-signal data are labeled, and the obtained data include but are not limited to multi-dimensional bio-signal data of feeding behavior characteristics, multi-dimensional bio-signal data of rumination behavior characteristics, multi-dimensional bio-signal data of standing behavior characteristics, multi-dimensional bio-signal data of moving behavior characteristics, and multi-dimensional bio-signal data of lying behavior characteristics;
[0037] Data windowing: performing data windowing on the multi-dimensional biosignal data to obtain a multi-dimensional biosignal data set;
[0038] Signal amplitude modulation: performing signal amplitude modulation on the multidimensional biosignal segments in the multidimensional biosignal data set one by one, and returning the amplitude-modulated multidimensional biosignal segments to the multidimensional biosignal data set. The signal amplitude modulation formula is:
[0039]
[0040] Among them, H Amplitude (a) represents the signal amplitude modulation function; Any multidimensional biological signal in the multidimensional biological signal eigenvalue input matrix representing the sheep's behavioral characteristics; τ i (i=1,2,3) represents the weight coefficient; ∈ represents the amplitude fluctuation factor corresponding to the maximum attenuation; ω represents the signal frequency; ω c represents the cutoff frequency; N represents the signal amplitude modulation coefficient; s represents the complex variable of the signal in the Laplace domain; k represents the modulus parameter of the elliptic integral;
[0041] Feature extraction: extracting key feature information from the multi-dimensional bio-signal segments in the multi-dimensional bio-signal data set one by one, and saving the data after key feature information extraction into the multi-dimensional bio-signal data set;
[0042] Feature dimensionality reduction: Based on the conditional probability distribution random field embedding method, a multi-dimensional biological signal feature input value matrix of sheep behavior characteristics is constructed;
[0043] Scaling and normalization processing: The multi-dimensional biological signal feature data in the multi-dimensional biological signal feature value input matrix of the sheep behavior characteristics is scaled and normalized. The formula is:
[0044]
[0045] Among them, a represents any multi-dimensional biological signal feature data point in the multi-dimensional biological signal feature value input matrix of sheep behavior characteristics; a i represents the i-th data point of the multidimensional biological signal feature vector in the multidimensional biological signal feature value input matrix; n represents the number of multidimensional biological signal feature data points in the multidimensional biological signal feature value input matrix of the sheep behavior characteristics;
[0046] Combining the methods in steps S1 and S2, i.e., collecting the individual's multi-dimensional biological signals through wearable sensing technology and collecting video recording information through video technology, after data processing, an input matrix is obtained, which is defined as follows:
[0047]
[0048]
[0049] in, represents the multi-dimensional biosignal data acquired from the start time t0 to the end time t; Represents a multi-dimensional biological signal data vector; t0 represents the start time of data acquisition; t represents the end time of data acquisition; that is, data measurement and acquisition are achieved through the above process.
[0050] Preferably, in step S3, the multi-layer learning classification model of weight cross-fusion operation and hierarchical extraction consists of an input layer, a cross-fusion layer, an excitation function layer, a sampling layer, a dense connection layer and an output layer, and is used to process time series data and image data;
[0051] The weight cross fusion operation formula is:
[0052]
[0053] Among them, Cov[P * (x (i,j) ,y (i,j) ,z (i,j) ),K] represents the element of the i-th row and j-th column of the tensor obtained after the cross-fusion operation; P * (x (i+m,j+n) ,y (i+m,j+n) ,z (i+m,j+n) ) represents the input tensor P * (x (i,j) ,y (i,j) ,z (i,j) )'s i+mth and j+nth columns; K (m,n) Represents the element in the mth row and nth column of the weight function K; M and N represent the height and width of the weight function respectively;
[0054] The activation function formula is:
[0055]
[0056] Among them, f activation (x (i,j) ,y (i,j) ,z (i,j) ) represents the activation function; ω i (i=1,2,3) represents the weight coefficient of the activation function;
[0057] The sampling function formula is:
[0058]
[0059] Among them, f sampling (x (i,j) ,y (i,j) ,z (i,j) ) represents the sampling function; p, q represent the length of the sampling window respectively; h represents the step size of the sampling window;
[0060] Preferably, in step S4, the sheep behavior feature recognition model is preset, including: dividing the multi-dimensional biological signal feature value input matrix and the behavior feature image data input matrix into a training set, a validation set and a test set according to a proportion, and inputting the obtained training set into the preset sheep behavior feature recognition model for training, and then using the obtained validation set to verify the trained sheep behavior feature recognition model after obtaining the network weight, and adjusting the weight matrix and variable parameters according to the verification results, and performing model evaluation according to the test results, and finally obtaining the sheep behavior feature recognition model;
[0061] During the training process, the sheep behavior feature recognition model performs data error calculation through forward propagation;
[0062] The output error calculation formula is:
[0063]
[0064] Where W T The weight matrix representing the input data parameters; θ l Variable parameters representing input data parameters;
[0065] The obtained output error is compared with the expected value. If the expected effect is not achieved, the input data in the sheep behavior feature recognition model is scaled by back propagation, and the weight matrix and variable parameters in the multi-layer learning classification model are corrected. The data is continuously iterated to reduce the error. After the expected effect is achieved, the sheep behavior feature recognition model is obtained.
[0066] Preferably, the weight matrix and the variable parameters are corrected, that is, the output error is corrected, and the error formula is:
[0067]
[0068] Where N represents the number of input data parameters; n L Indicates the dimension of the input data parameter; Indicates the expected output value; Indicates the actual output value;
[0069] The error formula E is related to the weight matrix and the variable parameter. The weight matrix formula and the variable parameter formula are:
[0070]
[0071]
[0072] Where N represents the number of input data parameters; W T represents the weight matrix; θ l represents a variable parameter; μ represents a correction constant;
[0073] By adjusting the weight matrix and variable parameters, repeatedly updating the model and cross-validation, the model performance can be improved until the expected effect is achieved; the trained and verified model is tested using the test set, and the confusion matrix of the model is calculated. The sheep behavior feature recognition model is actively updated according to the performance indicators of the confusion matrix, and the model parameters are adjusted to obtain the optimal sheep behavior feature recognition model.
[0074] Preferably, in step S5, the formula for constructing the hierarchical input matrix is:
[0075] Suppose there are three different wearable sensors that generate three different biosignal data, denoted as x, y, and z:
[0076]
[0077]
[0078]
[0079]
[0080] Where, represents the hierarchical input matrix; Represents a multi-dimensional biological signal eigenvalue input matrix; Represents the matrix of behavioral feature image data to be identified; δ signal features Represents the multi-dimensional biological signal eigenvalue matrix to be identified The corresponding classification coefficient; δ video Represents the matrix of behavioral feature image data to be identified The corresponding classification coefficient; x ij represents the jth data point of the i-th feature of the biological signal data x, where y ij 、z ij Similarly; represents the classification coefficient of the jth data point of the i-th feature of the biological signal data x, where Similarly;
[0081] Secondly, the judgment results are output according to the threshold judgment mechanism. The five different behavioral features are recorded as A, B, C, D, and E. The five node vectors output by the model are [P A ,P B ,P C ,P D ,P E ], the formula of the threshold judgment mechanism is:
[0082]
[0083] Where, P max represents the maximum probability; P second represents the second largest probability; θ1, θ2, θ3 represent multiple set thresholds; argmax(P i ) represents the largest index in the input vector of the function; NaN represents failure and inability to find the optimal value; μ represents the output result;
[0084] Finally, the judgment result μ is output according to the threshold judgment mechanism; the recognition credibility rate is P A 、P B 、P C 、P D and P E One of them represents the probability that the model predicts that the sample behavior belongs to five different behavioral characteristics A, B, C, D, E.
[0085] Preferably, in step S6, the sheep behavior characteristic results include but are not limited to behavior characteristic category labels, identity number labels and recognition confidence rates;
[0086] Based on the method in steps S1-S6, i.e., using wearable sensing technology to collect multi-dimensional biological signals of individuals and video technology to collect video recording information, after data processing, the data is input into the sheep recognition model to further output the sheep behavior recognition results; to represent the sheep behavior prediction process, the overall steps are defined as follows:
[0087]
[0088] That is, the above process is used to predict the behavioral characteristics of sheep.
[0089] The present invention also provides a sheep behavior feature recognition system, comprising:
[0090] Data acquisition module, which has the functions of data information collection, data information storage and data information transmission;
[0091] Data processing module, which has the functions of data information correction, compensation and data processing;
[0092] Behavioral feature recognition module, which has the functions of data reception, data storage, data analysis and data judgment;
[0093] The visual output module has the function of providing sheep behavior characteristics and sheep identification numbers to breeders in text display.
[0094] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0095] The present invention provides a method and system for identifying sheep behavioral characteristics. The method identifies sheep behavioral characteristics through multi-dimensional biological signal data of sheep and video recording information of sheep behavioral characteristics, further monitors the health status and biological rhythm of sheep, thereby better realizing the production potential of sheep and improving the economic benefits of farms. BRIEF DESCRIPTION OF THE DRAWINGS
[0096] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0097] Figure 1 A schematic diagram of a method flow chart provided in Example 1 of the present invention;
[0098] Figure 2 A specific flow chart of the method provided in Example 1 of the present invention;
[0099] Figure 3 A schematic diagram of the system structure provided in the second embodiment of the present invention;
[0100] Figure 4 This is a simple schematic diagram of the multi-dimensional bio-signal multi-sensor integrated unit for sheep behavior recognition according to the present invention.
[0101] Description of reference numerals:
[0102] 201 - data acquisition module, 202 - data processing module, 203 - behavior feature recognition module, 204 - visualization output module. DETAILED DESCRIPTION
[0103] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0104] The purpose of the present invention is to provide a method and system for identifying sheep behavioral characteristics, which can identify sheep behavioral characteristics through multi-dimensional biological signal data of sheep and video recording information of sheep behavioral characteristics, further monitor the health status and biological rhythm of sheep, thereby better realizing the production potential of sheep and improving the economic benefits of farms.
[0105] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0106] Example 1
[0107] like Figure 1 As shown, the present invention provides a method for identifying sheep behavior characteristics, comprising the following steps:
[0108] S1. Obtain video recording information of sheep behavioral characteristics through video monitoring equipment, process the video recording information, and construct a behavioral characteristic image data input matrix;
[0109] S2. Acquire multi-dimensional biological signal data of the sheep's behavioral characteristics, process the multi-dimensional biological signal data, and construct a multi-dimensional biological signal characteristic value input matrix of the sheep's behavioral characteristics;
[0110] S3, a multi-layer learning classification model based on weighted cross-fusion operation and hierarchical feature extraction, and a preset sheep behavior feature recognition model;
[0111] S4. Inputting the behavioral characteristic image data input matrix and the multi-dimensional biological signal characteristic value input matrix into a preset sheep behavioral characteristic recognition model for training, verification, and testing. Adjusting the weight matrix and variable parameters based on the verification results, and evaluating the model based on the test results to ultimately obtain a sheep behavioral characteristic recognition model.
[0112] S5. Apply the sheep behavior feature recognition model to real-world scenarios, construct a matrix of behavior feature image data to be recognized and a matrix of multi-dimensional biological signal feature values to be recognized, and combine the classification function to construct a classification input matrix;
[0113] S6. Input the obtained hierarchical input matrix into the sheep behavior feature recognition model, and output the corresponding sheep behavior feature results to complete the sheep behavior feature recognition.
[0114] Reference Figure 2 First, in step S1, the processing of the video recording information includes: extracting frames from the video recording information of the sheep's behavioral characteristics to obtain image data, and marking the sheep's behavioral characteristic category and sheep identification number in the image data, and then gray-scaling, image enhancement, and encoding serialization are performed on the marked image data to construct a behavioral characteristic image data input matrix;
[0115] The video surveillance device is a device used to capture, record, and monitor video images of a specific area or location. The video surveillance device is installed on the four corner railings of the sheep pen, with the camera facing the sheep breeding area, to collect video recording information of the behavioral characteristics of the flocked sheep. The collected video recording information of the sheep's behavioral characteristics is cropped and selected to obtain relatively high-definition video clips, and the video recording information of the sheep's behavioral characteristics is returned.
[0116] It should be noted that, in order to clearly distinguish the performance of sheep with various behavioral characteristics, this embodiment defines five categories of sheep behavioral characteristics, namely, feeding behavior characteristics, rumination behavior characteristics, standing behavior characteristics, moving behavior characteristics and lying behavior characteristics; in addition, the definitions of these five categories of sheep behavioral characteristics are not all the behavioral characteristics of sheep. This embodiment provides a textual description of these five categories of sheep behavioral characteristics to facilitate the subsequent explanation of the specific implementation content; in the actual implementation process, sheep will produce other behavioral characteristics, which is also within the scope of consideration of the present invention and will not be described one by one here.
[0117] The definition of feeding behavior characteristics is that sheep are located near the trough and chew and swallow feed, hay, etc.; the definition of rumination behavior characteristics is that sheep return partially digested rough food from the rumen to the mouth and chew it again; the definition of standing behavior characteristics is that sheep stand upright and remain motionless or make small movements; the definition of moving behavior characteristics is that sheep have obvious signs of movement in their limbs and the movement distance is greater than half of their body; the definition of lying behavior characteristics is the behavior characteristics exhibited by sheep when they are resting, lying down or sleeping; slight movement of sheep during lying behavior characteristics, such as napping, slowly turning around or stretching, is allowed;
[0118] Furthermore, in order to ensure the authenticity and reliability of the measured data and the robustness of the multi-layer learning classification model, the basic biological characteristics, breeding environment, feeding management, nutritional level and other conditions of the monitored sheep need to be consistent; the basic biological characteristics include but are not limited to the sheep species, sheep gender, sheep age, etc.; in this embodiment, external stimuli such as feeding, personnel passing, manual feeding, and entering the sheep pen are designed, and the time nodes of the external stimuli are recorded; the recording of the time nodes can assist in analyzing the behavioral characteristics of the sheep; for example, when the staff feeds the sheep, the sheep show feeding behavior characteristics, and the time node at this time is the distinguishing point between the feeding behavior characteristics and other behavioral characteristics;
[0119] Performing frame extraction processing on the video recording information of the sheep behavior characteristics: cropping and selecting the obtained video recording information of the sheep behavior characteristics to obtain high-definition video clips, and returning the video recording information of the sheep behavior characteristics; dividing the video recording information of the sheep behavior characteristics according to the frames that constitute the video, and extracting image information from each frame of the video and saving it as separate image data;
[0120] Grayscale processing is a method of converting the color image data obtained after frame extraction into a grayscale image, that is, converting the RGB (red, green, and blue) three-channel color information of each pixel in the color image into a grayscale value, thereby reducing the complexity of the image data, simplifying the image data and extracting the brightness information; Grayscale processing saves storage space, simplifies algorithm calculations, and plays an important role in image processing and analysis, and to a certain extent improves the robustness of the multi-layer learning classification model based on weighted cross-fusion operation and hierarchical feature extraction;
[0121] The formula for grayscale processing is:
[0122]
[0123] Among them, P ij Represents the grayscale value of the pixel in the i-th row and j-th column; R ij , G ij 、B ij Represent the pixel values of the three channels of the pixel point in the i-th row and j-th column respectively;
[0124] Furthermore, in order to improve the robustness of the multi-layer learning classification model and increase the diversity and quantity of training data, the image data in the sheep behavior feature image data set is enhanced; the image data enhancement includes: transforming and processing the original image by applying mirror flipping, random rotation, random cropping, color conversion, noise addition, translation transformation, scale transformation and deformation transformation;
[0125] The coding serialization is to encode the pixels in the image and then arrange the encoded pixels into sequence data; the details of the original image are retained to the greatest extent through the coding serialization operation;
[0126] The formula for encoding serialization is:
[0127] S ij =f ASCII (P ij )×f Unicode (P ij )=int(P ij ×(K-1) / 255)×int(P ij ×(L-1) / 255),i,j=1,2,…,n;
[0128]
[0129] Among them, Si j Represents the element in row i and column j of the sequence data; f ASCII () represents the ASCII encoding function, which converts the pixel gray value into the corresponding ASCII encoding value; f Unicode () represents the Unicode encoding function, which converts the pixel grayscale value into the corresponding Unicode code value; K represents the length of the ASCII character set; L represents the length of the Unicode character set; S represents the image data input sub-matrix after encoding serialization; T represents transposition; Represents the image data input sub-vector arranged in row-major or column-major manner; represents the image data acquired from the start time t0 to the end time t; t0 represents the start time of data acquisition; t represents the end time of data acquisition;
[0130] The image data input sub-matrices after grayscale processing, image enhancement and encoding serialization are stacked to construct the behavioral feature image data input matrix.
[0131] Secondly, in step S2, after obtaining the multi-dimensional bio-signal data, the multi-dimensional bio-signal data needs to be pre-processed, including removing abnormal multi-dimensional bio-signal data points in the multi-dimensional bio-signal data and compensating for missing multi-dimensional bio-signal data points in the multi-dimensional bio-signal data;
[0132] Assume that three different biological signal data are obtained, denoted as x, y, and z respectively. The formula for judging abnormal data points in multi-dimensional biological signal data is:
[0133]
[0134]
[0135] Among them, P * (x i ,y i ,z i ) represents a multi-dimensional biological signal data point in the multi-dimensional biological signal data; P(x i ,y i ,z i ) represents any multi-dimensional biological signal data point in the sheep multi-dimensional biological signal data; d k (P * (x i ,y i ,z i ),P(x i ,y i ,z i )) represents the distance between two multi-dimensional biological signal data, N k (P * (x i ,y i ,z i )) represents the multi-dimensional biological signal data points in P * (x i ,y i ,z i ) is the center of the circle, k is the area formed by the radius; k is a constant;
[0136] Compensate for missing data points in multi-dimensional biosignal data, specifically:
[0137] Determine the multi-dimensional biological signal data that is similar to the required compensation data point. The similarity measurement formula is:
[0138]
[0139] in, Represents the similarity metric of two multi-dimensional biological signal data, represents the mean;
[0140] Through the similarity measurement formula, similar multi-dimensional biological signal data is obtained, and the compensation value prediction calculation is performed on it. The formula is as follows:
[0141]
[0142] Among them, μ represents the expected value of the total parameter of compensation prediction weight; Represents similar multi-dimensional biological signal data obtained by similarity measurement calculation; Represents the homogeneous weight parameter of the i-th vector parameter; Represents the parameter dimension of the i-th vector parameter; Represents the correction constant.
[0143] Next, in step S2, the processing of the multi-dimensional biosignal data includes:
[0144] Behavior labeling and identity number labeling: The obtained multi-dimensional bio-signal data is classified in combination with the video recording information of the sheep's behavioral characteristics, and the behavioral characteristic categories and sheep's identity numbers of the classified multi-dimensional bio-signal data are labeled, and the obtained data include but are not limited to multi-dimensional bio-signal data of feeding behavior characteristics, multi-dimensional bio-signal data of rumination behavior characteristics, multi-dimensional bio-signal data of standing behavior characteristics, multi-dimensional bio-signal data of moving behavior characteristics, and multi-dimensional bio-signal data of lying behavior characteristics;
[0145] Among them, reference Figure 4 , respiratory change signals, body temperature change signals, multi-dimensional acceleration change signals, multi-dimensional angular velocity change signals and multi-dimensional magnetic induction change signals are collected by a multi-dimensional bio-signal multi-sensor integrated unit; the composition of the multi-dimensional bio-signal multi-sensor integrated unit includes but is not limited to wearable sensors such as respiratory sensors, body temperature sensors, acceleration sensors, angular velocity sensors and magnetic induction sensors; the multi-dimensional bio-signal multi-sensor integrated unit composed of the wearable sensors can be fixed to the neck, legs and torso of the sheep by means of flexible straps, patches, etc.; preferably, the wearable sensors used to constitute the multi-dimensional bio-signal multi-sensor integrated unit need to have the advantages of strong endurance, small size, light weight, good waterproofness, high safety, high quality, simple operation, large range and high resolution, and the multi-dimensional bio-signal multi-sensor integrated unit needs to be able to stably, real-time and accurately record the multi-dimensional bio-signal data of the sheep;
[0146] Data windowing: The multi-dimensional biosignal data is windowed to obtain a multi-dimensional biosignal data set; the data windowing method is as follows: a sliding window with a fixed time interval is set on the data set, and then the sliding window is moved on the data set, and each time a data window with a fixed time interval is taken and saved as a behavioral feature multi-dimensional biosignal data segment; it is worth noting that there is a 50% data overlap between each two adjacent data windows with a fixed time interval; setting the overlapping part between the data windows can make the data between each window not completely independent, but have a certain overlap, which can reduce information loss and can more smoothly capture data changes; preferably, in order to better analyze and process data and achieve monitoring and prediction, the size of the sliding window can be adjusted according to actual needs;
[0147] Signal amplitude modulation: During the data acquisition process, due to the influence of the on-site environment or the limitations of the physical properties of the sensor itself, the signal is often subject to various interferences during the acquisition process, which will introduce noise. In order to suppress the noise component, improve the signal quality, reduce the signal distortion and facilitate the subsequent feature extraction, the multi-dimensional biosignal segments in the multi-dimensional biosignal data set are amplitude modulated one by one, and the amplitude-modulated multi-dimensional biosignal segments are returned to the multi-dimensional biosignal data set. The signal amplitude modulation formula is:
[0148]
[0149] Among them, H Amplitude (a) represents the signal amplitude modulation function; Any multidimensional biological signal in the multidimensional biological signal eigenvalue input matrix representing the sheep's behavioral characteristics; τ i (i=1,2,3) represents the weight coefficient; ∈ represents the amplitude fluctuation factor corresponding to the maximum attenuation; ω represents the signal frequency; ω c represents the cutoff frequency; N represents the signal amplitude modulation coefficient; s represents the complex variable of the signal in the Laplace domain; k represents the modulus parameter of the elliptic integral;
[0150] Feature extraction: To reduce computational costs, eliminate redundant information, and improve model performance, key feature information is extracted from the multidimensional biosignal segments in the multidimensional biosignal data set one by one. The extracted key feature information is then saved in the multidimensional biosignal feature data set of sheep behavior characteristics.
[0151] To better illustrate this embodiment, some characteristics and their related calculation formulas are listed below:
[0152]
[0153]
[0154] Feature dimensionality reduction processing: Feature dimensionality reduction processing is the process of mapping high-dimensional data to a low-dimensional space. Its purpose is to reduce the dimension and complexity of the data while retaining the data information as much as possible. When processing multi-dimensional biosignal data sets, feature dimensionality reduction processing is used to reduce the dimension of the features, thereby improving the computational efficiency and generalization ability of the hierarchical learning model. Feature dimensionality reduction processing is a feature dimensionality reduction processing method based on the conditional probability distribution random neighborhood embedding method. The conditional probability distribution random neighborhood embedding method achieves dimensionality reduction by defining a probability distribution in a high-dimensional space and a low-dimensional space, and then minimizing the relative entropy divergence between data points in these two spaces. Through the above operations, a multi-dimensional biosignal eigenvalue input matrix of sheep behavior characteristics is finally constructed.
[0155] Scaling and normalization processing: The multi-dimensional biological signal feature data in the multi-dimensional biological signal feature value input matrix of the sheep behavior characteristics is scaled and normalized. The formula is:
[0156]
[0157] Among them, a represents any multi-dimensional biological signal feature data point in the multi-dimensional biological signal feature value input matrix of sheep behavior characteristics; a i represents the i-th data point of the multidimensional biological signal feature vector in the multidimensional biological signal feature value input matrix; n represents the number of multidimensional biological signal feature data points in the multidimensional biological signal feature value input matrix of the sheep behavior characteristics.
[0158] Again, in step S3, a multi-layer learning classification model of weight cross-fusion operation and hierarchical extraction is composed of an input layer, a cross-fusion layer, an activation function layer, a sampling layer, a dense connection layer and an output layer, and is used to process time series data and image data;
[0159] There is an optional method for saving the multi-dimensional biological signal characteristic value input matrix of sheep behavior characteristics: save the sheep multi-dimensional biological signal characteristic data in Excel file format, the basic structure of which is as follows (assuming that three different wearable sensors are used to generate three different biological signal data, which are recorded as x, y and z respectively);
[0160]
[0161] in, The kth element representing the i-th signal feature of the x-change signal ( Similarly); p represents the signal characteristics Behavior category label;
[0162] Combining the methods in steps S1 and S2, that is, collecting the individual's multi-dimensional biological signals through wearable sensing technology and collecting video recording information through video technology, and obtaining the input matrix after data processing; in order to more intuitively represent the data measurement and acquisition implementation process, the overall step method is defined as follows:
[0163]
[0164]
[0165] in, represents the multi-dimensional biosignal data acquired from the start time t0 to the end time t; Represents a multi-dimensional biological signal data vector; t0 represents the start time of data acquisition; t represents the end time of data acquisition; that is, data measurement and acquisition are achieved through the above process.
[0166] Furthermore, the process of establishing and obtaining a sheep behavior feature recognition model based on a multi-layer learning classification model based on weight cross-fusion operation and hierarchical feature extraction is as follows:
[0167] The input layer receives the original data as input; the cross-fusion layer performs cross-fusion operations through a series of weight functions to extract the learning features of the input data and capture the spatial information of the data; the excitation function layer uses the excitation function to increase the nonlinear features of the network, so that the multi-layer learning classification model can better fit the nonlinear data distribution; the sampling layer reduces the dimensionality of the learning features, reduces the computational complexity while maintaining the main features, and improves the computational efficiency and classification ability of the multi-layer learning classification; multiple dense connection layers are connected after the sampling layer to map the extracted learning features to the classifier; the fully connected layer maps the learning feature vector to a high-dimensional space through linear changes in the weight matrix and bias terms for subsequent classification tasks; the output layer is an excitation function layer using a normalized exponential function, which converts the output of the multi-layer learning classification model into category probability, and performs multi-level judgment according to the preset threshold, and finally outputs the classification prediction category; it is worth noting that during the entire training process, the backpropagation algorithm is used to adjust the network parameters; by calculating the loss function, the difference between the network prediction result and the true label can be determined, and the network parameters are updated according to the difference to improve the performance and accuracy of the model;
[0168] The weight cross fusion operation formula is:
[0169]
[0170] Among them, Cov[P * (x (i,j) ,y (i,j) ,z (i,j) ),K] represents the element of the i-th row and j-th column of the tensor obtained after the cross-fusion operation; P * (x (i+m,j+n) ,y (i+m,j+n) ,z (i+m,j+n) ) represents the input tensor P * (x (i,j) ,y (i,j) ,z (i,j) )'s i+mth and j+nth columns; K (m,n) Represents the element in the mth row and nth column of the weight function K; M and N represent the height and width of the weight function respectively.
[0171] The activation function formula is:
[0172]
[0173] Among them, f activation (x(i,j) ,y (i,j) ,z (i,j) ) represents the activation function; ω i (i=1, 2, 3) represents the weight coefficient of the activation function;
[0174] The sampling function formula is:
[0175]
[0176] Among them, f sampling (x (i,j) ,y (i,j) ,z (i,j) ) represents the sampling function; p, q represent the length of the sampling window respectively; h represents the step size of the sampling window;
[0177] Among them, in step S4, the preset sheep behavior feature recognition model includes: dividing the multi-dimensional biological signal feature value input matrix and the behavior feature image data input matrix into a training set, a verification set and a test set according to a proportion, and inputting the obtained training set into the preset sheep behavior feature recognition model for training, and then using the obtained verification set to verify the trained sheep behavior feature recognition model after obtaining the network weight, and adjusting the weight matrix and variable parameters according to the verification results, and evaluating the model according to the test results, and finally obtaining the sheep behavior feature recognition model;
[0178] During the training process, the sheep behavior feature recognition model calculates data errors through forward propagation;
[0179] The output error calculation formula is:
[0180]
[0181] Where W T The weight matrix representing the input data parameters; θ l Variable parameters representing input data parameters;
[0182] The obtained output error is compared with the expected value. If the expected effect is not achieved, the input data in the sheep behavior feature recognition model is scaled through back propagation to perform data error scaling, and the weight matrix and variable parameters in the multi-layer learning classification model are corrected. The data is continuously iterated to reduce the error. After the expected effect is achieved, the sheep behavior feature recognition model is obtained.
[0183] Correct the weight matrix and variable parameters, that is, correct the output error. The error formula is:
[0184]
[0185] Where N represents the number of input data parameters; n LIndicates the dimension of the input data parameter; Indicates the expected output value; Indicates the actual output value;
[0186] Among them, the error formula E is related to the weight matrix and variable parameters. The weight matrix formula and variable parameter formula are:
[0187]
[0188]
[0189] Where N represents the number of input data parameters; W T represents the weight matrix; θ l represents a variable parameter; μ represents a correction constant;
[0190] By adjusting the weight matrix and variable parameters, repeatedly updating the model and cross-validation, the model performance can be improved until the expected effect is achieved; the trained and verified model is tested using the test set, and the confusion matrix of the model is calculated. The sheep behavior feature recognition model is actively updated according to the performance indicators of the confusion matrix, and the model parameters are adjusted to obtain the optimal sheep behavior feature recognition model.
[0191] The confusion matrix is an m×m matrix (where m represents the number of behavioral feature categories) and includes four elements: true positive examples, true negative examples, false positive examples, and false negative examples. The confusion matrix provides a method for intuitively understanding the performance of the model in different categories. Based on the confusion matrix, a series of evaluation indicators can be calculated, such as accuracy, precision, recall rate, and F1 score, which help to more comprehensively evaluate the performance of the model.
[0192] In addition, in step S5, video recording information and multi-dimensional biological signal data of sheep behavioral characteristics are obtained dynamically, in real time, and continuously; the video recording information is subjected to frame extraction processing, grayscale processing, image enhancement, and coding serialization to construct a behavioral characteristic image data to-be-identified matrix; the multi-dimensional biological signal data is subjected to signal amplitude modulation, data windowing, feature extraction, and feature dimensionality reduction processing to construct a multi-dimensional biological signal eigenvalue to-be-identified matrix; the multi-dimensional biological signal eigenvalue to-be-identified matrix and the behavioral characteristic image data to-be-identified matrix are combined with a hierarchical function to construct a hierarchical input matrix, and are input into the sheep behavioral characteristic recognition model; the construction formula of the hierarchical input matrix is:
[0193] Suppose there are three different wearable sensors that generate three different biosignal data, denoted as x, y, and z:
[0194]
[0195]
[0196]
[0197]
[0198] Where, represents the hierarchical input matrix; Represents a multi-dimensional biological signal eigenvalue input matrix; Represents the matrix of behavioral feature image data to be identified; δ signal features Represents the multi-dimensional biological signal eigenvalue matrix to be identified The corresponding classification coefficient; δ video Represents the matrix of behavioral feature image data to be identified The corresponding classification coefficient; x ij represents the jth data point of the i-th feature of the biological signal data x, where y ij 、z ij Similarly; represents the classification coefficient of the jth data point of the i-th feature of the biological signal data x, where Similarly;
[0199] Secondly, the judgment results are output according to the threshold judgment mechanism. The five different behavioral features are recorded as A, B, C, D, and E. The five node vectors output by the model are [P A ,P B ,P C ,P D ,P E ], the formula of the threshold judgment mechanism is:
[0200]
[0201] Where, P max represents the maximum probability; P second represents the second largest probability; θ1, θ2, θ3 represent multiple set thresholds; argmax(P i ) represents the largest index in the input vector of the function; NaN represents failure and inability to find the optimal value; μ represents the output result;
[0202] When the output result μ=NaN, the behavior characteristics of the current sheep are determined based on the experience of the breeder, and the sheep behavior characteristic recognition model is trained again using the determination result and the hierarchical input matrix to obtain the optimal sheep behavior characteristic recognition model;
[0203] Finally, the judgment result μ is output according to the threshold judgment mechanism; the recognition credibility rate is P A 、P B 、P C 、PD and P E One of them represents the probability that the model predicts that the sample behavior belongs to five different behavioral characteristics A, B, C, D, E.
[0204] Finally, in step S6, the sheep behavior feature results include but are not limited to behavior feature category labels, identity number labels, and recognition confidence rates.
[0205] Based on the method in steps S1-S6, i.e., using wearable sensing technology to collect multi-dimensional biological signals of individuals and video technology to collect video recording information, after data processing, the data is input into the sheep recognition model to further output the sheep behavior recognition results; in order to more intuitively represent the sheep behavior prediction process, the overall steps are defined as follows:
[0206]
[0207] In this embodiment, a multi-dimensional biological signal characteristic value input matrix and a behavioral characteristic image data input matrix under different behavioral characteristics of sheep (including feeding behavior characteristics, rumination behavior characteristics, standing behavior characteristics, moving behavior characteristics and lying behavior characteristics) are obtained and input into a sheep behavior characteristic recognition model; based on 13427 sets of test data, the method of the present invention and the existing traditional method are compared, and the results are shown in Table 1.
[0208] Table 1 Comparison results of predictions between the traditional method and this embodiment
[0209]
[0210]
[0211] Combined with the results in Table 1, it can be shown that this embodiment is superior to the traditional method and has higher recognition performance;
[0212] Example 2
[0213] like Figure 3 As shown, the present invention also provides a sheep behavior feature recognition system, including
[0214] The data acquisition module 201 has the functions of data collection, data storage and data transmission; it can dynamically, in real time and continuously acquire multi-dimensional biological signal data of sheep and video recording information of sheep behavioral characteristics; and the data acquisition module 201 needs to transmit the acquired data to the host computer for subsequent operations;
[0215] The data processing module 202 has the functions of data information correction, compensation and data processing; it is necessary to eliminate abnormal multi-dimensional bio-signal data points in the multi-dimensional bio-signal data of the sheep; the data processing module 202 is necessary to compensate for missing multi-dimensional bio-signal data points in the multi-dimensional bio-signal data of the sheep; the data processing module 202 is necessary to extract signal features of the multi-dimensional bio-signal data of the sheep and output them as multi-dimensional bio-signal feature data of the sheep; the data processing module 202 is necessary to perform frame extraction processing on the feature video recording information to obtain image data, so as to construct a behavioral feature image data set;
[0216] The behavior feature recognition module 203 has the functions of data reception, data storage, data analysis and data determination; it inputs the multi-dimensional biological signal feature data set and the behavior feature image set into the sheep behavior feature recognition model to perform behavior feature determination and output the sheep behavior feature recognition result; the behavior feature recognition module 203 stores the sheep behavior feature result;
[0217] The visual output module 204 has the function of providing the breeder with a text display of the sheep's behavioral characteristics and sheep identification number; if abnormal behavior occurs, the visual output module 204 needs to remind the breeder to help the breeder make a decision.
[0218] Therefore, the present invention adopts the above-mentioned sheep behavior characteristic identification method and system, which, on the one hand, realizes the accurate identification of the behavior characteristics of sheep during the breeding process, and on the other hand, improves the welfare of sheep and the quality of sheep breeding during the sheep breeding stage. It also identifies the behavior characteristics of sheep through the multi-dimensional biological signal data of sheep and the video recording information of sheep behavior characteristics, and further monitors the health status and biological rhythm of sheep, so as to better realize the production potential of sheep and improve the economic benefits of the farm.
[0219] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A method for identifying sheep behavior characteristics, characterized in that: The following steps are involved: S1. Obtain video recording information of sheep behavioral characteristics through video monitoring equipment, process the video recording information, and construct a behavioral characteristic image data input matrix; S2. Acquire multi-dimensional biological signal data of the sheep's behavioral characteristics, process the multi-dimensional biological signal data, and construct a multi-dimensional biological signal characteristic value input matrix of the sheep's behavioral characteristics; In step S2, after obtaining the multi-dimensional bio-signal data, the multi-dimensional bio-signal data needs to be pre-processed, including removing abnormal multi-dimensional bio-signal data points in the multi-dimensional bio-signal data and compensating for missing multi-dimensional bio-signal data points in the multi-dimensional bio-signal data; Assume that three different biosignal data are obtained, denoted as x, y, and z respectively. The formula for determining abnormal data points in the multi-dimensional biosignal data is: ; in, Representing a multi-dimensional biosignal data point in the multi-dimensional biosignal data; Represents any multi-dimensional biological signal data point in the sheep's multi-dimensional biological signal data; Represents the distance between two multi-dimensional biological signal data, Represents multi-dimensional biological signal data points is the center of the circle, k is the area formed by the radius; k is a constant; S3, a multi-layer learning classification model based on weighted cross-fusion operation and hierarchical feature extraction, and a preset sheep behavior feature recognition model; S4. Inputting the behavioral characteristic image data input matrix and the multi-dimensional biological signal characteristic value input matrix into a preset sheep behavioral characteristic recognition model for training, verification, and testing. Adjusting the weight matrix and variable parameters based on the verification results, and evaluating the model based on the test results to ultimately obtain a sheep behavioral characteristic recognition model. S5. Apply the sheep behavior feature recognition model to real-world scenarios, construct a matrix of behavior feature image data to be recognized and a matrix of multi-dimensional biological signal feature values to be recognized, and combine the classification function to construct a classification input matrix; S6. Input the obtained hierarchical input matrix into the sheep behavior feature recognition model, and output the corresponding sheep behavior feature results to complete the sheep behavior feature recognition.
2. A sheep behavior feature recognition method according to claim 1, characterized in that: In step S1, the processing of the video recording information includes: extracting frames from the video recording information of the sheep behavior characteristics to obtain image data, and marking the sheep behavior characteristic category and sheep identification number in the image data, and then gray-scaling, image enhancement, and encoding serialization on the marked image data to construct a behavior characteristic image data input matrix; Performing frame extraction processing on the video recording information of the sheep behavior characteristics: cropping and selecting the obtained video recording information of the sheep behavior characteristics to obtain high-definition video clips, and returning the video recording information of the sheep behavior characteristics; dividing the video recording information of the sheep behavior characteristics according to the frames constituting the video, and extracting image information from each frame of the video and saving it as separate image data; The formula for the grayscale processing is: ; in, Represents the grayscale value of the pixel in the i-th row and j-th column; Represent the pixel values of the three channels of the pixel point in the i-th row and j-th column respectively; The image data enhancement is to transform and process the original image by applying mirror flipping, random rotation, random cropping, color transformation, noise addition, translation transformation, scale transformation and deformation transformation; The coding serialization is as follows: encoding the pixels in the image and then arranging the encoded pixels into sequence data; The formula for encoding serialization is: ; ; in, Represents the element in row i and column j of the sequence data; Represents the ASCII encoding function, which converts the pixel grayscale value into the corresponding ASCII encoding value; Represents the Unicode encoding function, which converts the pixel grayscale value into the corresponding Unicode code value; K represents the length of the ASCII character set; L represents the length of the Unicode character set; S represents the image data input submatrix after encoding serialization; T represents transpose; Represents the image data input sub-vector arranged in row-major or column-major manner; Indicates the start time Until the end time the acquired image data; Indicates the start time of data acquisition; Indicates the end time of data acquisition; The image data input sub-matrices after grayscale processing, image enhancement and encoding serialization are stacked to construct the behavioral feature image data input matrix.
3. The sheep behavior feature recognition method according to claim 1, characterized in that: Compensating for missing data points in the multi-dimensional biosignal data is performed, specifically: Determine the multi-dimensional biological signal data that is similar to the required compensation data point. The similarity measurement formula is: ; in, Represents the similarity metric of two multi-dimensional biological signal data, represents the mean; Through the similarity measurement formula, similar multi-dimensional biological signal data is obtained, and the compensation value prediction calculation is performed on it. The formula is as follows: ; in, represents the expected value of the total parameter of compensation prediction weight; Represents similar multi-dimensional biological signal data obtained by similarity measurement calculation; Indicates the Homogeneous weight parameters of the vector parameters; Indicates the The parameter dimension of the vector parameter; Represents the correction constant.
4. A sheep behavior feature recognition method according to claim 3, characterized in that: In step S2, the processing of the multi-dimensional biosignal data includes: Behavior labeling and identity number labeling: The obtained multi-dimensional bio-signal data is classified in combination with the video recording information of the sheep's behavioral characteristics, and the behavioral characteristic categories and sheep's identity numbers of the classified multi-dimensional bio-signal data are labeled, and the obtained data include but are not limited to multi-dimensional bio-signal data of feeding behavior characteristics, multi-dimensional bio-signal data of rumination behavior characteristics, multi-dimensional bio-signal data of standing behavior characteristics, multi-dimensional bio-signal data of moving behavior characteristics, and multi-dimensional bio-signal data of lying behavior characteristics; Data windowing: performing data windowing on the multi-dimensional biosignal data to obtain a multi-dimensional biosignal data set; Signal amplitude modulation: performing signal amplitude modulation on the multidimensional biosignal segments in the multidimensional biosignal data set one by one, and returning the amplitude-modulated multidimensional biosignal segments to the multidimensional biosignal data set. The signal amplitude modulation formula is: in, represents the signal amplitude modulation function; Any multi-dimensional biological signal in the multi-dimensional biological signal eigenvalue input matrix representing the sheep's behavioral characteristics; Represents the weight coefficient, i=1, 2, 3; Indicates the amplitude fluctuation factor corresponding to the maximum attenuation; Indicates the signal frequency; represents the cutoff frequency; Indicates the signal amplitude modulation coefficient; represents the complex variable of the signal in the Laplace domain; k represents the modulus parameter of the elliptic integral; Feature extraction: extract key information features from the multi-dimensional bio-signal segments in the multi-dimensional bio-signal data set one by one, and save the data after key feature information extraction into the multi-dimensional bio-signal data set; Feature dimensionality reduction: Based on the conditional probability distribution random field embedding method, a multi-dimensional biological signal feature input value matrix of sheep behavior characteristics is constructed; Scaling and normalization processing: The multi-dimensional biological signal feature data in the multi-dimensional biological signal feature value input matrix of the sheep behavior characteristics is scaled and normalized. The formula is: ; Wherein, a represents any multi-dimensional biological signal characteristic data point in the multi-dimensional biological signal characteristic value input matrix of the sheep behavior characteristics; represents the i-th data point of the multidimensional biological signal feature vector in the multidimensional biological signal feature value input matrix; n represents the number of multidimensional biological signal feature data points in the multidimensional biological signal feature value input matrix of the sheep behavior characteristics; Combining the methods in steps S1 and S2, i.e., collecting the individual's multi-dimensional biological signals through wearable sensing technology and collecting video recording information through video technology, after data processing, an input matrix is obtained, which is defined as follows: ; Indicates the start time Until the end time The acquired multi-dimensional biological signal data; Represents a multi-dimensional biological signal data vector; Indicates the start time of data acquisition; Indicates the end time of data acquisition; that is, data measurement and collection are achieved through the above process.
5. The sheep behavior feature recognition method according to claim 1, characterized in that: In step S3, the multi-layer learning classification model of weight cross-fusion operation and hierarchical extraction consists of an input layer, a cross-fusion layer, an activation function layer, a sampling layer, a dense connection layer and an output layer, and is used to process time series data and image data; The weight cross fusion operation formula is: ; in, Represents the element in the i-th row and j-th column of the tensor obtained after the cross-fusion operation; Represents the input tensor The element in the i+mth and j+nth columns of ; Represents the element in the mth row and nth column of the weight function K; M and N represent the height and width of the weight function respectively; The activation function formula is: ; in, represents the activation function; Represents the weight coefficient of the activation function, i=1, 2, 3; The sampling function formula is: ; in, represents the sampling function; They represent the length of the sampling window respectively; h represents the step size of the sampling window.
6. The sheep behavior feature recognition method according to claim 1, characterized in that: In the step S4, the sheep behavior feature recognition model is preset, including: dividing the multi-dimensional biological signal feature value input matrix and the behavior feature image data input matrix into a training set, a validation set and a test set according to a proportion, and inputting the obtained training set into the preset sheep behavior feature recognition model for training, and then using the obtained validation set to verify the trained sheep behavior feature recognition model after obtaining the network weight, and adjusting the weight matrix and variable parameters according to the verification results, and evaluating the model according to the test results, and finally obtaining the sheep behavior feature recognition model; During the training process, the sheep behavior feature recognition model performs data error calculation through forward propagation; The output error calculation formula is: ; Where, The weight matrix representing the input data parameters; Variable parameters representing input data parameters; The obtained output error is compared with the expected value. If the expected effect is not achieved, the input data in the sheep behavior feature recognition model is scaled by back propagation, and the weight matrix and variable parameters in the multi-layer learning classification model are corrected. The data is continuously iterated to reduce the error. After the expected effect is achieved, the sheep behavior feature recognition model is obtained.
7. A sheep behavior feature recognition method according to claim 6, characterized in that: Correct the weight matrix and variable parameters, that is, correct the output error. The error formula is: ; Where, Indicates the number of input data parameters; Indicates the dimension of the input data parameter; Indicates the expected output value; Indicates the actual output value; Among them, the error formula Related to the weight matrix and variable parameters, the weight matrix formula and variable parameter formula are: ; ; Where, Indicates the number of input data parameters; represents the weight matrix; Indicates variable parameters; represents the correction constant; By adjusting the weight matrix and variable parameters, repeatedly updating the model and cross-validation, the model performance can be improved until the expected effect is achieved; the trained and verified model is tested using the test set, and the confusion matrix of the model is calculated. The sheep behavior feature recognition model is actively updated according to the performance indicators of the confusion matrix, and the model parameters are adjusted to obtain the optimal sheep behavior feature recognition model.
8. The sheep behavior feature recognition method according to claim 1, characterized in that: In step S5, the formula for constructing the hierarchical input matrix is: Suppose there are three different wearable sensors that generate three different biosignal data, denoted as x, y, and z: ; ; ; ; Where, represents the hierarchical input matrix; Represents a multi-dimensional biological signal eigenvalue input matrix; Represents the matrix of behavioral feature image data to be identified; Represents the multi-dimensional biological signal eigenvalue matrix to be identified The corresponding classification coefficient; Represents the matrix of behavioral feature image data to be identified The corresponding classification coefficient; represents the jth data point of the i-th feature of the biological signal data x, where 、 Similarly; represents the classification coefficient of the jth data point of the i-th feature of the biological signal data x, where 、 Similarly; Secondly, the judgment results are output according to the threshold judgment mechanism. The five different behavioral features are recorded as A, B, C, D, and E. The five node vectors output by the model are [ ], the formula of the threshold judgment mechanism is: ; Where, represents the maximum probability; Indicates the second highest probability; Indicates multiple set thresholds; Indicates taking the largest index in the input vector of the function; Indicates failure and inability to find the optimal value; Indicates the output result; Finally, the judgment result is output according to the threshold judgment mechanism ; Recognition confidence rate is One of them represents the probability that the model predicts that the sample behavior belongs to five different behavioral characteristics A, B, C, D, E.
9. The sheep behavior feature recognition method according to claim 1, characterized in that: In step S6, the sheep behavior feature results include but are not limited to behavior feature category labels, identity number labels, and recognition confidence rates; Based on the method in steps S1-S6, that is, using wearable sensing technology to collect multi-dimensional biological signals of individuals and video technology to collect video recording information, after data processing, input into the sheep recognition model to further output the sheep behavior recognition results, the overall steps are defined as follows: ; That is, the above process is used to predict the behavioral characteristics of sheep.
10. A sheep behavior feature recognition system, characterized in that: include: Data acquisition module, which has the functions of data information collection, data information storage and data information transmission; Data processing module, which has the functions of data information correction, compensation and data processing; Behavioral feature recognition module, which has the functions of data reception, data storage, data analysis and data judgment; The visual output module has the function of providing sheep behavior characteristics and sheep identification numbers to breeders in text display.
Citation Information
Patent Citations
Method and system for identifying individual identities of sheep flock in sheep house based on YOLOv4
CN114529840A
Wool cashmere fiber surface morphological structure chart identification method based on image enhancement
CN116051410A