Farming environment control method and system based on environmental characteristics and pig behavior characteristics

By constructing an environmental regulation model, combining the environmental characteristics of pig houses and behavioral characteristics, the pig house environment is regulated in real time, and the lag and artificial subjectivity of traditional regulation methods are solved, the health and comfort of pigs are improved, and the amount of labor is reduced.

CN118192717BActive Publication Date: 2025-03-18SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410387002.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2025-03-18
Estimated Expiration
2044-04-01

AI Technical Summary

Technical Problem

Traditional pig house environmental regulation methods have lag problems and are highly subjective, making it difficult to regulate the environment effectively in a timely and effective manner, affecting the comfort and health of pigs.

Method used

A breeding environment regulation method based on environmental characteristics and pig behavior characteristics is adopted. By obtaining pig farm environmental factor data and pig video data, an environmental regulation model is constructed, including environmental factor prediction module, pig behavior analysis module and environmental factor control module, and environmental parameters are analyzed and regulated in real time.

Benefits of technology

Real-time and precise regulation of the pig house environment is achieved, artificial interference is reduced, the comfort and health level of pigs is improved, and the early warning function is provided, reducing the amount of manual labor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118192717B_ABST
    Figure CN118192717B_ABST
Patent Text Reader

Abstract

The present invention discloses a breeding environment control method and system based on environmental characteristics and pig behavior characteristics, and relates to the field of breeding environment control technology. The present invention can automatically control the temperature and humidity, carbon dioxide and ammonia concentrations in a pig house in real time and timely according to the needs of pigs, realize automated environmental control, and improve the health and welfare level of pigs; according to the environmental characteristics in the pig farm and the behavioral characteristics of pigs, the pig house is regulated to a suitable temperature and humidity environment to prevent pigs from having stress reactions, and can timely prevent the concentration of harmful gases in the pig house from exceeding the standard, and prevent the harm caused to pigs by excessive concentration of harmful gases; the environmental parameters of the pig house can be effectively predicted, and the pig behavior can be identified through the improved SlowFast network, effectively improving the identification accuracy; it has an early warning function, can timely detect abnormal conditions of equipment in the pig house and remind staff to carry out maintenance, and reduce manual labor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of breeding environment regulation and control, and in particular to a breeding environment regulation and control method and system based on environmental characteristics and pig behavior characteristics. Background Art

[0002] The traditional method of intelligent regulation of the pig farm environment is mostly to conduct the next step of control by detecting whether the pig farm environmental parameters detected by fixed-point sensors in the pig house meet the environmental requirements in the pig house. This method can be summarized as a feedback environmental regulation method based on the environmental parameter detection results, but this regulation method has a certain lag problem. It is necessary to wait until the equipment detects that the current local environment of the pig house is no longer within the range suitable for pig growth before environmental regulation is carried out. It is difficult to regulate the pig farm environment in time, and this regulation method cannot formulate corresponding regulation strategies based on the prediction of the changing trend of environmental parameters in the pig house, and the control efficiency is low. The judgment standard for whether the current environmental parameters of the pig house meet the environmental requirements in the pig house is artificially set, which is highly subjective. The rationality of the setting greatly affects the comfort of the pig herd, and it is easy to fail to effectively regulate the pig house environment due to mistakes or lack of experience of the staff.

[0003] Another common way to control the pig house environment is to estimate the pig house environmental characteristics based on the pig house environment, predict the environmental parameters that need to be controlled, and then further control by judging whether the predicted results meet the pig house environmental requirements. Although this control method can solve the lag problem to a certain extent, it first compares the predicted results with certain artificially set limit values. If the predicted results do not meet the limit requirements, the dynamic control of the environment is also highly subjective and cannot scientifically control the pig farm environment based on the specific perception of the pigs. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a breeding environment control method and system based on environmental characteristics and pig behavior characteristics, which solves the lag problem of the feedback environmental control method based on the environmental parameter detection results and the problem that the method based on manually setting limited parameters is easily interfered by subjective factors, resulting in the inability to effectively adjust the pig house environment.

[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:

[0006] A method for regulating a breeding environment based on environmental characteristics and pig behavior characteristics is provided, which comprises the following steps:

[0007] S1. Obtaining pig farm environmental factor data and current pig video data;

[0008] S2, preprocessing the pig farm environmental factor data to obtain a processed environmental data set;

[0009] S3, constructing an environmental regulation model; wherein the environmental regulation model includes an environmental factor prediction module, a pig behavior analysis module and an environmental factor control module;

[0010] S4, input the preprocessed environmental data set into the environmental factor prediction module to obtain the environmental prediction data for the next 1 hour;

[0011] S5, input the current pig video data, the current ammonia concentration in the house, the current air temperature in the house, the current relative humidity in the house and the current CO2 concentration in the house into the pig behavior analysis module to obtain the pig's perception data of the current environment;

[0012] S6. Input the environmental prediction data for the next hour and the pigs' perception data of the current environment into the environmental factor control module for regulation.

[0013] Furthermore, the pig farm environmental factor data include indoor ammonia concentration, indoor air temperature, indoor relative humidity, indoor ventilation volume, indoor CO2 concentration and outdoor average wind speed;

[0014] Step S2 further comprises:

[0015] S2-1. Eliminate the pig farm environmental factor data using a box plot, and fill the eliminated data set using a linear interpolation method to obtain a filled environmental data set;

[0016] S2-2, performing data denoising and normalization processing on the filled environmental data set to obtain a normalized environmental data set;

[0017] S2-3. Use the Pearson correlation coefficient to perform correlation analysis on the normalized environmental data set to obtain an analyzed environmental data set, that is, a preprocessed environmental data set.

[0018] Furthermore, the environmental factor prediction module includes an LSTM neural network, an attention mechanism module, and two GRU neural networks connected in series;

[0019] The pig behavior analysis module includes a pig detector, a pig behavior recognition submodule and a pig behavior analysis submodule; the pig detector adopts the Faster-Rcnn network model; the pig behavior recognition submodule includes a serially connected improved SlowFast model, a BERT network model and a behavior classification layer; the improved SlowFast model includes parallel slow channels and fast channels, each channel includes a serially connected DropRes2 block, a DropRes3 block, a Res4 layer and a Res5 layer; the DropRes2 block and the DropRes3 block both include a serially connected convolution block and a DropBlock layer; the convolution block includes a first convolution layer, a second convolution layer, a third convolution layer and a fourth convolution layer connected in parallel with the three convolution layers in sequence; the Res4 layer and the Res5 layer are both 3D convolution layers; wherein the size of the first convolution layer is 3*1*1, the size of the second convolution layer is 1*3*3, and the sizes of the third convolution layer and the fourth convolution layer are both 1*1*1; the behavior classification layer is a fully connected layer;

[0020] The environmental factor control module includes a temperature control unit, a humidity control unit and a harmful gas control unit.

[0021] Furthermore, the environmental prediction data for the next hour in step S4 includes temperature data, humidity data, ammonia data and CO2 data for the next hour;

[0022] Step S4 further comprises:

[0023] S4-1, input the preprocessed environmental data set into the LSTM neural network to obtain the corresponding primary environmental sequence information;

[0024] S4-2, input the environment sequence information into the attention mechanism module to obtain the corresponding importance score; assign different weights to the environment sequence information according to the importance score to obtain secondary environment sequence information;

[0025] S4-3, input the secondary environmental sequence information into the series-connected GRU neural network in sequence for prediction, and obtain the environmental prediction data for the next 1 hour.

[0026] Furthermore, step S5 further includes:

[0027] S5-1, detect the current pig video data through the Faster-Rcnn network model, and use the DeepSort algorithm to track the pig detection results to obtain the corresponding pig positioning information;

[0028] S5-2, sampling the current pig video data at sampling intervals of T and αT respectively to obtain low-frame pig data and high-frame pig data;

[0029] S5-3, inputting the low-frame pig data and the high-frame pig data into the corresponding DropRes2 block respectively, obtaining a low-frame pig spatiotemporal behavior feature vector and a high-frame pig spatiotemporal behavior feature vector;

[0030] S5-4, input the primary high-frame pig spatiotemporal behavior feature vector into the corresponding DropRes3 block to obtain the secondary high-frame pig spatiotemporal behavior feature vector; input the primary high-frame pig spatiotemporal behavior feature vector and the primary low-frame pig spatiotemporal behavior feature vector into the corresponding DropRes3 block after dimension conversion to obtain the secondary low-frame pig spatiotemporal behavior feature vector;

[0031] S5-5, input the secondary high-frame pig spatiotemporal behavior feature vector into the corresponding Res4 layer to obtain the tertiary high-frame pig spatiotemporal behavior feature vector; input the secondary high-frame pig spatiotemporal behavior feature vector into the corresponding Res4 layer after dimension conversion and the secondary low-frame pig spatiotemporal behavior feature vector to obtain the tertiary low-frame pig spatiotemporal behavior feature vector;

[0032] S5-6, input the three high-frame pig spatiotemporal behavior feature vectors into the corresponding Res5 layer to obtain the four high-frame pig spatiotemporal behavior feature vectors; input the three high-frame pig spatiotemporal behavior feature vectors into the corresponding Res5 layer after dimension conversion and the three low-frame pig spatiotemporal behavior feature vectors to obtain the four low-frame pig spatiotemporal behavior feature vectors;

[0033] S5-7, splicing the four high-frame pig spatiotemporal behavior feature vectors and the four low-frame pig spatiotemporal behavior feature vectors to obtain a spliced ​​pig spatiotemporal behavior feature vector;

[0034] S5-8, inputting the spliced ​​pig spatiotemporal behavior feature vectors into the BERT network model for feature fusion to obtain fused pig spatiotemporal feature data;

[0035] S5-9, input the fused spatiotemporal feature data of the pigs into the behavior classification layer, and classify them in combination with the pig positioning information to obtain the classified pig behavior data; wherein the pig behavior data includes resting behavior data, eating behavior data and activity behavior data, the resting behavior data includes side-lying behavior data and curled-up behavior data, the eating behavior data includes eating behavior data and drinking behavior data, and the activity behavior data includes fighting behavior, standing behavior and walking behavior;

[0036] S5-10, input the classified pig behavior data into the pig behavior analysis submodule, count the time proportion of all behaviors of each pig in the current hour, average the time proportion of all behaviors of all individual pigs to obtain the time proportion of all behaviors of the entire pig group, and obtain the pig behavior proportion data Ti;

[0037] S5-11. According to the different activity levels of the pigs in a day, a day is divided into different time periods, and the resting behavior stage LyT = {lt1; lt2; ...; ltm}, the eating behavior stage EaT = {et1; et2; ...; etn} and the activity behavior stage AcT = {at1; at2; ...; atk} are obtained respectively; wherein m, n and k are the total number of time periods corresponding to the resting behavior stage, the eating behavior stage and the activity behavior stage, and m+n+k = 24, {lt1; lt2; ...; ltm} are the time periods of the resting behavior stage, {et1; et2; ...; etn} are the time periods of the eating behavior stage, and {at1; at2; ...; atk} are the time periods of the activity behavior stage;

[0038] S5-12. Count the pig behavior data from the previous day to obtain the behavior percentage data of different behavior stages;

[0039] S5-13. Process the current pig herd according to the behavior proportion data of different behavior stages in step S5-11 and different behavior stages in step S5-12, and obtain the pig herd's perception data of the current temperature, humidity and harmful gas concentration, that is, the pigs' perception data of the current environment; wherein the harmful gas concentration includes the CO2 concentration and the ammonia concentration in the house.

[0040] Furthermore, the behavior proportion data of different behavior stages in step S5-12 include the behavior proportion data of the resting behavior stage, the behavior proportion data of the eating behavior stage and the behavior proportion data of the active behavior stage; the behavior proportion data of the resting behavior stage include the behavior proportion RestHighT corresponding to the highest temperature moment of the pig herd in all resting behavior stages, the behavior proportion RestLowT corresponding to the lowest temperature moment, the behavior proportion RestHighH corresponding to the highest relative humidity moment, the behavior proportion RestLowH corresponding to the lowest relative humidity moment and the behavior proportion RestHighGases corresponding to the highest concentration of harmful gases; the behavior proportion data of the eating behavior stage include the behavior proportion Ea corresponding to the highest temperature moment of the pig herd in all eating behavior stages tHighT, the behavior proportion corresponding to the lowest temperature EatLowT, the behavior proportion corresponding to the highest relative humidity EatHighH, the behavior proportion corresponding to the lowest relative humidity EatLowH and the behavior proportion corresponding to the highest concentration of harmful gases EatHighGases; the behavior proportion data of the active behavior stage include the behavior proportion ActiveHighT corresponding to the highest temperature, the behavior proportion ActiveLowT corresponding to the lowest temperature, the behavior proportion ActiveHighH corresponding to the highest relative humidity, the behavior proportion ActiveLowH corresponding to the lowest relative humidity and the behavior proportion ActiveHighGases corresponding to the highest concentration of harmful gases in all active behavior stages.

[0041] Furthermore, step S5-13 further includes:

[0042] S5-13-1, determine whether the current pig herd is in the resting behavior stage; if so, proceed to step S5-13-2; otherwise, proceed to step S5-13-5;

[0043] S5-13-2, perform similarity calculation and judgment on the current pig behavior proportion data Ti and the behavior proportion RestHighT corresponding to the highest temperature moment and the behavior proportion RestLowT corresponding to the lowest temperature moment. If the similarity between the current pig behavior proportion data Ti and the behavior proportion RestHighT is greater than the similarity between the current pig behavior proportion data Ti and the behavior proportion RestLowT, it is determined that the current pigs perceive the temperature as being hot; otherwise, it is determined that the current pigs perceive the temperature as being cold, that is, the perception data of the current temperature of the pigs in the resting behavior stage is obtained;

[0044] S5-13-3, the current pig behavior proportion data Ti are processed with the behavior proportion RestHighH corresponding to the highest relative humidity moment and the behavior proportion RestLowH corresponding to the lowest relative humidity moment respectively by the same processing method as step S5-13-2, to obtain the pigs' perception data of the current humidity, that is, to obtain the data that the pigs in the resting behavior stage perceive the current humidity as being high or low;

[0045] S5-13-4. Calculate the similarity between the current pig behavior proportion data Ti and the behavior proportion RestHighGases corresponding to the moment of the highest harmful gas concentration. If the corresponding similarity is greater than the threshold value 0.8, it is determined that the pigs' perception of the current harmful gas concentration is high. Otherwise, it is determined that the pigs' perception of the current harmful gas concentration is low. That is, the perception data of the pigs in the resting behavior stage on the current harmful gas concentration is obtained.

[0046] S5-13-5. Use the same processing method as steps S5-13-2 to S5-13-4 to obtain the perception data of the current temperature of the pigs in the active behavior stage, the perception data of the current humidity of the pigs in the active behavior stage, and the perception data of the current concentration of harmful gases of the pigs in the active behavior stage, or obtain the perception data of the current temperature of the pigs in the eating behavior stage, the perception data of the current humidity of the pigs in the eating behavior stage, and the perception data of the current concentration of harmful gases of the pigs in the eating behavior stage.

[0047] Furthermore, step S6 further includes:

[0048] S6-1, input the pigs' perception data of the current temperature and the temperature data of the next hour into the temperature control unit, determine the size of the current temperature and the temperature data of the next hour, and control the temperature according to the pigs' perception data of the current temperature;

[0049] S6-2, input the pigs' perception data of the current humidity and the humidity data for the next hour into the humidity control unit, determine the magnitude of the current humidity and the humidity data for the next hour, and control the humidity according to the pigs' perception data of the current humidity;

[0050] S6-3. The pigs' perception data on the current harmful gas concentration and the ammonia data and CO2 data for the next hour are input into the harmful gas control unit, and the harmful gas control unit performs control based on the harmful gas concentration for the next hour, the current harmful gas concentration and the pigs' perception data on the harmful gas concentration.

[0051] Furthermore, the specific process of step S6-1 is as follows:

[0052] If the pigs perceive the current temperature as being too hot, determine whether the current temperature is lower than the temperature data for the next hour. If so, turn on the cooling mechanism of the pig farm and cool the farm in advance. Otherwise, do not adjust the temperature for the time being.

[0053] If the pigs perceive the current temperature as being cold, then determine whether the current temperature is greater than the temperature data for the next hour. If so, turn on the pig farm's heating mechanism and heat the farm in advance. Otherwise, do not regulate it for the time being.

[0054] The specific process of step S6-2 is:

[0055] If the pigs' perception of the current humidity is too high, it is determined whether the current humidity is lower than the humidity data for the next hour for two consecutive times. If so, the fan is turned on for ventilation, otherwise no control is temporarily performed;

[0056] If the pigs' perception of the current humidity is low, it is determined whether the current humidity is greater than the humidity data for the next hour for two consecutive times. If so, the water curtain is opened, otherwise no regulation is temporarily performed;

[0057] The specific process of step S6-3 is:

[0058] If the concentration of ammonia and CO2 data in the next hour is higher than the normal standard or the pigs' perception of the current harmful gas concentration is high for two consecutive times and the cumulative value exceeds two times, the fan will be turned on for ventilation, otherwise no regulation will be made for the time being;

[0059] After ventilation control has been carried out at the current moment, if the pig herd's perception data of harmful gas concentration is still too high at the next moment, an early warning will be triggered and the staff will be notified to carry out inspection and control.

[0060] A breeding environment control system based on environmental characteristics and pig behavior characteristics is provided, which includes a data acquisition module, a data preprocessing module, an environmental factor prediction module, a pig behavior analysis module and an environmental factor control module; wherein:

[0061] Data collection module, used to collect and store pig farm environmental factor data and pig video data every hour;

[0062] A data preprocessing module is used to preprocess the pig farm environmental factor data and pig video data to obtain a preprocessed environmental data set;

[0063] The environmental factor prediction module is used to obtain the environmental prediction data for the next hour using the preprocessed environmental data set;

[0064] The pig behavior analysis module is used to analyze the pig video data and the current environmental factor data to obtain the pig's perception data of the current environment;

[0065] The environmental factor control module is used to regulate the pig house environment based on the pigs' perception data of the current environment and the environmental prediction data for the next hour.

[0066] The beneficial effects of the present invention are:

[0067] (1) The present invention uses the different behavioral patterns of pigs in different environments to analyze the pigs' perception of the surrounding environment, and can effectively judge the pigs' perception of the current temperature, humidity, and harmful gas concentration in the pig house; it overcomes the human interference factors caused by the traditional limit value-based environmental control, so that the pigs are always in the best breeding environment that meets the pigs' needs, and automatically updates the behavioral data every day, making the environmental control more objective and reasonable; it combines the SlowFast algorithm and DropBlock to solve the problem of difficulty in identifying behaviors with time series characteristics, and can effectively prevent overfitting while accelerating convergence. In view of the characteristics of pigs' fast movement amplitude and strong burstiness when stressed, BERT is applied to the spatiotemporal features of SlowFast output to better model the temporal information of pig behavior characteristics, improve the ability to recognize pig behavior, and help the environmental factor control module better combine behavioral data to control the pig farm environment.

[0068] (2) The present invention can automatically adjust the environmental parameters of the pig house to prevent the occurrence of conditions such as excessively high or low temperature, excessively high or low humidity, and excessively high harmful concentrations, thereby placing the pigs in an environment suitable for their growth, reducing the probability of pigs becoming sick, and thereby reducing the losses of the breeding staff; it has an early warning function and can monitor the pig house environment in real time, promptly discovering abnormal conditions of the equipment in the pig house and reminding the staff to carry out maintenance, thereby reducing the amount of manual labor. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 is a flow chart of the method of the present invention;

[0070] Figure 2 It is the technical roadmap of the present invention;

[0071] Figure 3 This is the flowchart of the environmental factor prediction module;

[0072] Figure 4 It is the structural diagram of the improved SlowFast model;

[0073] Figure 5 It is the residual structure diagram of DropRes;

[0074] Figure 6 This is a comparison chart of DropOut and DropBlock operations;

[0075] Figure 7 Flowchart of the pig behavior analysis submodule. DETAILED DESCRIPTION

[0076] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0077] like Figure 1 and Figure 2 As shown, a breeding environment control method based on environmental characteristics and pig behavior characteristics is provided, comprising the following steps:

[0078] S1. Obtain the pig farm environmental factor data and the current pig video data; wherein the pig farm environmental factor data include the ammonia concentration in the house, the air temperature in the house, the relative humidity in the house, the ventilation volume in the house, the CO2 concentration in the house and the average wind speed outside the house;

[0079] S2, preprocessing the pig farm environmental factor data to obtain a processed environmental data set;

[0080] Step S2 further comprises:

[0081] S2-1. Use the box plot to eliminate the pig farm environmental factor data, and use the linear interpolation method to fill the eliminated data set to obtain the filled environmental data set; the formula of the box plot is:

[0082] Up=Q3+1.5×IQR

[0083] Low=Q1-1.5×IQR

[0084] IQR=Q3-Q1

[0085] Among them, Up is the upper limit of the threshold, Low is the lower limit of the threshold, Q1 and Q3 are the first quartile and the third quartile of the pig farm environmental factor data, respectively, and IQR is the difference between the first quartile Q1 and the third quartile Q3 of the pig farm environmental factor data.

[0086] The pig farm environmental factor data that does not fall within the threshold range [Up, Low] are regarded as outliers and eliminated, and then the linear interpolation method is used to fill the eliminated data sets and the empty values ​​that cannot be collected by the environmental sensors.

[0087] S2-2. Perform data denoising and normalization processing on the filled environmental data set to obtain a normalized environmental data set; wherein, data denoising uses the Kalman filter algorithm to further improve the stability of the environmental data; in order to eliminate the influence of different dimensions on the environmental factor prediction module, normalization processing is further used to improve the convergence speed and accuracy of the environmental factor prediction module.

[0088] S2-3. Use the Pearson correlation coefficient to perform correlation analysis on the normalized environmental data set to obtain the correlation of each environmental data, and remove the normalized environmental data with a correlation less than a threshold to obtain an analyzed environmental data set, that is, a preprocessed environmental data set. The threshold is set according to the actual situation.

[0089] S3, constructing an environmental regulation model; wherein the environmental regulation model includes an environmental factor prediction module, a pig behavior analysis module and an environmental factor control module;

[0090] S4. Input the preprocessed environmental data set into the environmental factor prediction module to obtain the environmental prediction data for the next hour; the environmental prediction data for the next hour in step S4 includes temperature data, humidity data, ammonia data and CO2 data for the next hour.

[0091] The environmental factor prediction module includes an LSTM neural network, an attention mechanism module and two GRU neural networks connected in series; this structure can automatically explore the features that play a key role in the prediction results on the basis of retaining long-term information, avoid complex feature engineering and improve the robustness of the model.

[0092] like Figure 3 As shown, step S4 further includes:

[0093] The step S4 further comprises:

[0094] S4-1, input the preprocessed environmental data set into the LSTM neural network to obtain the corresponding primary environmental sequence information;

[0095] S4-2, input the environment sequence information into the attention mechanism module to obtain the corresponding importance score; assign different weights to the environment sequence information according to the importance score to obtain secondary environment sequence information;

[0096] S4-3, input the secondary environmental sequence information into the series-connected GRU neural network in sequence for prediction, and obtain the environmental prediction data for the next 1 hour.

[0097] S5, input the current pig video data, the current ammonia concentration in the house, the current air temperature in the house, the current relative humidity in the house and the current CO2 concentration in the house into the pig behavior analysis module to obtain the pig's perception data of the current environment;

[0098] The pig behavior analysis module includes a pig detector, a pig behavior recognition submodule and a pig behavior analysis submodule; the pig detector adopts the Faster-Rcnn network model; the pig behavior recognition submodule includes a serially connected improved SlowFast model, a BERT network model and a behavior classification layer; the improved SlowFast model includes parallel slow channels and fast channels, each channel uses 3DRes50 as the backbone network to extract features, and fuses the information of the two channels through lateral connections, such as Figure 4 and Figure 5 As shown, each channel includes a DropRes2 block, a DropRes3 block, a Res4 layer, and a Res5 layer connected in series; the DropRes2 block and the DropRes3 block each include a convolution block and a DropBlock layer connected in series; the convolution block includes a first convolution layer, a second convolution layer, a third convolution layer, and a fourth convolution layer connected in parallel with the three convolution layers in series in sequence; the Res4 layer and the Res5 layer are both 3D convolution layers; wherein the size of the first convolution layer is 3*1*1, the size of the second convolution layer is 1*3*3, and the sizes of the third convolution layer and the fourth convolution layer are both 1*1*1; the behavior classification layer is a fully connected layer, and the Softmax function is used to implement behavior classification;

[0099] The slow channel increases the dimension of the input spatial information and reduces the dimension of the temporal information, making the slow channel more focused on extracting spatial feature information. The fast channel has fewer convolution kernels and weaker ability to process spatial information, but does not require temporal pooling to reduce temporal resolution, so the fast channel can pay more attention to information about temporal changes. Finally, the features output by the two channels are fused and input into the fully connected layer for behavior classification.

[0100] The DropBlock layer uses a regularization method for CNN, which randomly blocks features. Figure 1 Some continuous areas, such as Figure 6 As shown, (a) is the original input image, (b) is the result after DropOut processing, and (c) is the result after DropBlock processing. The DropBlock layer is added to the Res2 and Res3 stages in the SlowFast network to obtain the SlowFast model of the present invention, which can better extract useful information while effectively preventing overfitting.

[0101] The BERT network model is designed to perform unsupervised pre-training on unlabeled datasets by aggregating information and data context in both left and right directions. Although the SlowFast model has the ability to effectively capture spatiotemporal features in dual channels with high temporal resolution, the pooling operation in the spatiotemporal dimensions in the two channels at the end of the 3D convolutional backbone destroys the final temporal pattern. Therefore, the BERT network is added to the SlowFast network backend to fully utilize the temporal relationship in the spatiotemporal features generated by SlowFast and improve the ability to recognize pig behavior.

[0102] like Figure 7 As shown, step S5 further includes:

[0103] S5-1, detect the current pig video data through the Faster-Rcnn network model, and use the DeepSort algorithm to track the pig detection results to obtain the corresponding pig positioning information;

[0104] S5-2, sampling the current pig video data at sampling intervals of T and αT respectively to obtain low-frame pig data and high-frame pig data;

[0105] S5-3, inputting the low-frame pig data and the high-frame pig data into the corresponding DropRes2 block respectively, obtaining a low-frame pig spatiotemporal behavior feature vector and a high-frame pig spatiotemporal behavior feature vector;

[0106] S5-4, input the primary high-frame pig spatiotemporal behavior feature vector into the corresponding DropRes3 block to obtain the secondary high-frame pig spatiotemporal behavior feature vector; input the primary high-frame pig spatiotemporal behavior feature vector and the primary low-frame pig spatiotemporal behavior feature vector into the corresponding DropRes3 block after dimension conversion to obtain the secondary low-frame pig spatiotemporal behavior feature vector;

[0107] S5-5, input the secondary high-frame pig spatiotemporal behavior feature vector into the corresponding Res4 layer to obtain the tertiary high-frame pig spatiotemporal behavior feature vector; input the secondary high-frame pig spatiotemporal behavior feature vector into the corresponding Res4 layer after dimension conversion and the secondary low-frame pig spatiotemporal behavior feature vector to obtain the tertiary low-frame pig spatiotemporal behavior feature vector;

[0108] S5-6, input the three high-frame pig spatiotemporal behavior feature vectors into the corresponding Res5 layer to obtain the four high-frame pig spatiotemporal behavior feature vectors; input the three high-frame pig spatiotemporal behavior feature vectors into the corresponding Res5 layer after dimension conversion and the three low-frame pig spatiotemporal behavior feature vectors to obtain the four low-frame pig spatiotemporal behavior feature vectors;

[0109] S5-7, splicing the four high-frame pig spatiotemporal behavior feature vectors and the four low-frame pig spatiotemporal behavior feature vectors to obtain a spliced ​​pig spatiotemporal behavior feature vector;

[0110] S5-8, inputting the spliced ​​pig spatiotemporal behavior feature vectors into the BERT network model for feature fusion to obtain fused pig spatiotemporal feature data;

[0111] S5-9, input the fused spatiotemporal feature data of the pigs into the behavior classification layer, and classify them in combination with the pig positioning information to obtain the classified pig behavior data; wherein the pig behavior data includes resting behavior data, eating behavior data and activity behavior data, the resting behavior data includes side-lying behavior data and curled-up behavior data, the eating behavior data includes eating behavior data and drinking behavior data, and the activity behavior data includes fighting behavior, standing behavior and walking behavior;

[0112] S5-10, input the classified pig behavior data into the pig behavior analysis submodule, count the time proportion of all behaviors of each pig in the current hour, average the time proportion of all behaviors of all individual pigs to obtain the time proportion of all behaviors of the entire pig group, and obtain the pig behavior proportion data Ti; wherein the formula of Ti is:

[0113]

[0114] Wherein, PTij = (pT1; pT2; ...; pTd), d is the time length, PTij is the proportion of the j-th pig's behavior in the i-th hour, (pT1; pT2; ...; pTd) is the proportion of the j-th pig's behavior in all hours of the time length d, and pM is the total number of pigs;

[0115] S5-11. Divide a day into different time periods according to the different levels of activity of pigs. Since different pig farms raise pigs at different times a day, pigs in different pig farms have different work and rest patterns throughout the day, which correspond to different levels of activity. Therefore, before conducting environmental regulation, it is necessary to divide different activity intervals according to the different levels of activity of pigs during the day. First, the two hours after the pig farm staff feeds the pigs is the time when the pigs start to eat. The pigs mainly eat, so the two hours after the breeder feeds them are divided into the pig eating behavior stage; secondly, before feeding, pigs will frequently search for food, during which time the pigs will mainly walk and engage in other behaviors involving pig movement, so the two hours before the breeder feeds them are divided into the pig activity behavior stage; in other time periods, the activity of the pigs will drop rapidly. If the value of the rest behavior stage is low, the pig is divided into the rest behavior stage, as shown in Table 1, and the rest behavior stage LyT={lt1;lt2;...;ltm}, the eating behavior stage EaT={et1;et2;...;etn} and the activity behavior stage AcT={at1;at2;...;atk} are obtained respectively; wherein m, n and k are the total number of time periods corresponding to the rest behavior stage, the eating behavior stage and the activity behavior stage, and m+n+k=24, {lt1;lt2;...;ltm} are the time periods of the rest behavior stage, {et1;et2;...;etn} are the time periods of the eating behavior stage, and {at1;at2;...;atk} are the time periods of the activity behavior stage; wherein AcT, LyT and EaT do not intersect with each other.

[0116] Table 1

[0117]

[0118] S5-12. Count the pig behavior data from the previous day to obtain the behavior percentage data of different behavior stages;

[0119] The behavior proportion data of different behavior stages in step S5-12 include the behavior proportion data of the resting behavior stage, the behavior proportion data of the eating behavior stage and the behavior proportion data of the active behavior stage; the behavior proportion data of the resting behavior stage include the behavior proportion corresponding to the highest temperature moment of the pig herd in all resting behavior stages RestHighT, the behavior proportion corresponding to the lowest temperature moment RestLowT, the behavior proportion corresponding to the highest relative humidity moment RestHighH, the behavior proportion corresponding to the lowest relative humidity moment RestLowH and the behavior proportion corresponding to the highest concentration of harmful gases RestHighGases; the behavior proportion data of the eating behavior stage include the behavior proportion corresponding to the highest temperature moment of the pig herd in all eating behavior stages EatHi ghT, the behavior proportion corresponding to the lowest temperature EatLowT, the behavior proportion corresponding to the highest relative humidity EatHighH, the behavior proportion corresponding to the lowest relative humidity EatLowH and the behavior proportion corresponding to the highest concentration of harmful gases EatHighGases; the behavior proportion data of the active behavior stage include the behavior proportion ActiveHighT corresponding to the highest temperature, the behavior proportion ActiveLowT corresponding to the lowest temperature, the behavior proportion ActiveHighH corresponding to the highest relative humidity, the behavior proportion ActiveLowH corresponding to the lowest relative humidity and the behavior proportion ActiveHighGases corresponding to the highest concentration of harmful gases in all active behavior stages.

[0120] S5-13. Process the current pig herd according to the behavior proportion data of different behavior stages in step S5-11 and different behavior stages in step S5-12, and obtain the pig herd's perception data of the current temperature, humidity and harmful gas concentration, that is, the pigs' perception data of the current environment; wherein the harmful gas concentration includes the CO2 concentration and the ammonia concentration in the house.

[0121] Step S5-13 further includes:

[0122] S5-13-1, determine whether the current pig herd is in the resting behavior stage, that is, in the time period of the resting behavior stage LyT = {lt1; lt2; ...; ltm}; if so, proceed to step S5-132; otherwise, proceed to step S5-13-5;

[0123] S5-13-2, perform similarity calculation and judgment on the current pig behavior proportion data Ti and the behavior proportion RestHighT corresponding to the highest temperature moment and the behavior proportion RestLowT corresponding to the lowest temperature moment. If the similarity between the current pig behavior proportion data Ti and the behavior proportion RestHighT is greater than the similarity between the current pig behavior proportion data Ti and the behavior proportion RestLowT, it is determined that the current pigs perceive the temperature as being hot; otherwise, it is determined that the current pigs perceive the temperature as being cold, that is, the perception data of the current temperature of the pigs in the resting behavior stage is obtained;

[0124] S5-13-3, the current pig behavior proportion data Ti are processed with the behavior proportion RestHighH corresponding to the highest relative humidity moment and the behavior proportion RestLowH corresponding to the lowest relative humidity moment respectively by the same processing method as step S5-13-2, to obtain the pigs' perception data of the current humidity, that is, to obtain the data that the pigs in the resting behavior stage perceive the current humidity as being high or low;

[0125] S5-13-4. Calculate the similarity between the current pig behavior proportion data Ti and the behavior proportion RestHighGases corresponding to the moment of the highest harmful gas concentration. If the corresponding similarity is greater than the threshold value 0.8, it is determined that the pigs' perception of the current harmful gas concentration is high. Otherwise, it is determined that the pigs' perception of the current harmful gas concentration is low. That is, the perception data of the pigs in the resting behavior stage on the current harmful gas concentration is obtained.

[0126] S5-13-5. Use the same processing method as steps S5-13-2 to S5-13-4 to obtain the perception data of the current temperature of the pigs in the active behavior stage, the perception data of the current humidity of the pigs in the active behavior stage, and the perception data of the current concentration of harmful gases of the pigs in the active behavior stage, or obtain the perception data of the current temperature of the pigs in the eating behavior stage, the perception data of the current humidity of the pigs in the eating behavior stage, and the perception data of the current concentration of harmful gases of the pigs in the eating behavior stage.

[0127] S6. Input the environmental prediction data for the next hour and the pigs' perception data of the current environment into the environmental factor control module for regulation.

[0128] The environmental factor control module includes a temperature control unit, a humidity control unit and a harmful gas control unit.

[0129] Step S6 further comprises:

[0130] S6-1, input the pigs' perception data of the current temperature and the temperature data of the next hour into the temperature control unit, determine the size of the current temperature and the temperature data of the next hour, and control the temperature according to the pigs' perception data of the current temperature;

[0131] The specific process of step S6-1 is:

[0132] The initial temperature of the pig farm is set to 20°C, and then every hour, the temperature of the pig farm is dynamically adjusted using this control method so that the pigs are always at the optimal breeding temperature.

[0133] If the pigs perceive the current temperature as being too hot, determine whether the current temperature is lower than the temperature data for the next hour. If so, turn on the cooling mechanism of the pig farm and cool the farm in advance. Otherwise, do not adjust the temperature for the time being.

[0134] If the pigs perceive the current temperature as being cold, then determine whether the current temperature is greater than the temperature data for the next hour. If so, turn on the pig farm's heating mechanism and heat the farm in advance. Otherwise, do not regulate it for the time being.

[0135] S6-2, input the pigs' perception data of the current humidity and the humidity data for the next hour into the humidity control unit, determine the magnitude of the current humidity and the humidity data for the next hour, and control the humidity according to the pigs' perception data of the current humidity;

[0136] The specific process of step S6-2 is:

[0137] If the pigs' perception of the current humidity is too high, it is determined whether the current humidity is lower than the humidity data for the next hour for two consecutive times. If so, the fan is turned on for ventilation, otherwise no control is temporarily performed;

[0138] If the pigs' perception of the current humidity is low, it is determined whether the current humidity is greater than the humidity data for the next hour for two consecutive times. If so, the water curtain is opened, otherwise no regulation is temporarily performed;

[0139] Among them, according to the pig house environmental temperature control standard requirements, the initial value of the relative humidity of the pig farm is set to 65%. After that, the humidity of the pig farm is dynamically adjusted every hour using this adjustment method so that the humidity can be adjusted in time to meet the needs of the pigs.

[0140] S6-3. The pigs' perception data on the current harmful gas concentration and the ammonia data and CO2 data for the next hour are input into the harmful gas control unit, and the harmful gas control unit performs control based on the harmful gas concentration for the next hour, the current harmful gas concentration and the pigs' perception data on the harmful gas concentration.

[0141] The specific process of step S6-3 is:

[0142] If the concentration of ammonia data and CO2 data in the next hour is greater than the normal standard, that is, the ammonia data in the next hour is greater than 9.1 mg / m 3 Or the concentration of CO2 data is greater than 500mg / m 3 , or if the pigs' perception of the current harmful gas concentration is high for two consecutive times and the cumulative number exceeds two times, the fan will be turned on for ventilation, otherwise no regulation will be made temporarily;

[0143] After ventilation control has been carried out at the current moment, if the pig herd's perception data of harmful gas concentration is still too high at the next moment, an early warning will be triggered and the staff will be notified to carry out inspection and control.

[0144] A breeding environment control system based on environmental characteristics and pig behavior characteristics, comprising a data acquisition module, a data preprocessing module, an environmental factor prediction module, a pig behavior analysis module and an environmental factor control module; wherein:

[0145] The data acquisition module is used to collect and store the environmental factor data of the pig farm and the video data of the pigs every hour; the environmental factors in the pig farm are collected through sensors such as temperature, humidity, ammonia, carbon dioxide and wind speed. Among them, a temperature sensor and a humidity sensor are set inside and outside the pig farm, a wind speed sensor is set outside the pig farm, and harmful gas sensors are set in the four corners of the pig farm. The data sampling interval is 1 hour, and the data is collected continuously for 24 hours. A 2D color camera with a frame rate of 30fps is set just above the pig pen to collect the image data of the pigs 24 hours a day and store it. Among them, the camera is 3m from the ground to ensure that all the breeding pigs in the pig pen can be fully captured, and all the behaviors of the individual pigs can also be observed.

[0146] A data preprocessing module is used to preprocess the pig farm environmental factor data and pig video data to obtain a preprocessed environmental data set;

[0147] The environmental factor prediction module is used to obtain the environmental prediction data for the next hour using the preprocessed environmental data set;

[0148] The pig behavior analysis module is used to analyze the pig video data and the current environmental factor data to obtain the pig's perception data of the current environment;

[0149] The environmental factor control module is used to regulate the pig house environment based on the pigs' perception data of the current environment and the environmental prediction data for the next hour.

[0150] In summary, the present invention can automatically adjust various environmental parameters in the pig house according to the needs of pigs in real time and timely, realize automated environmental control, and improve the health and welfare level of pigs; adjust the pig house to a suitable temperature and humidity environment according to the environmental characteristics in the pig farm and the behavioral characteristics of the pigs, prevent the pigs from having a stress response, and can timely prevent the concentration of harmful gases in the pig house from exceeding the standard, and prevent the harm to pigs caused by excessive concentration of harmful gases; can effectively predict the environmental parameters of the pig house, and identify pig behavior through the improved SlowFast network, effectively improving the identification accuracy; it has an early warning function, can promptly detect abnormal conditions of equipment in the pig house and remind staff to carry out maintenance, thereby reducing manual labor.

Claims

1. A method for regulating and controlling a breeding environment based on environmental characteristics and pig behavior characteristics, characterized in that: The following steps are involved: S1. Obtaining pig farm environmental factor data and current pig video data; S2, preprocessing the pig farm environmental factor data to obtain a preprocessed environmental data set; S3, constructing an environmental regulation model; wherein the environmental regulation model includes an environmental factor prediction module, a pig behavior analysis module and an environmental factor control module; S4, input the preprocessed environmental data set into the environmental factor prediction module to obtain the environmental prediction data for the next 1 hour; S5, the current pig video data, the current ammonia concentration in the house, the current air temperature in the house, the current relative humidity in the house and the current The concentration is input into the pig behavior analysis module to obtain the pig's perception data of the current environment; S6, inputting the environmental prediction data for the next hour and the pigs' perception data of the current environment into the environmental factor control module for regulation; The pig farm environmental factor data include indoor ammonia concentration, indoor air temperature, indoor relative humidity, indoor ventilation volume, indoor concentration and average wind speed outside the house; The step S2 further comprises: S2-1. Eliminate the pig farm environmental factor data using a box plot, and fill the eliminated data set using a linear interpolation method to obtain a filled environmental data set; S2-2, performing data denoising and normalization processing on the filled environmental data set to obtain a normalized environmental data set; S2-3, using the Pearson correlation coefficient to perform correlation analysis on the normalized environmental data set to obtain an analyzed environmental data set, that is, a preprocessed environmental data set; The environmental factor prediction module includes an LSTM neural network, an attention mechanism module and two GRU neural networks connected in series; The pig behavior analysis module includes a pig detector, a pig behavior recognition submodule and a pig behavior analysis submodule; the pig detector adopts the Faster-Rcnn network model; the pig behavior recognition submodule includes a serially connected improved SlowFast model, a BERT network model and a behavior classification layer; the improved SlowFast model includes parallel slow channels and fast channels, each channel includes a serially connected DropRes2 block, a DropRes3 block, a Res4 layer and a Res5 layer; the DropRes2 block and the DropRes3 block both include a serially connected convolution block and a DropBlock layer; the convolution block includes a first convolution layer, a second convolution layer, a third convolution layer and a fourth convolution layer connected in parallel with the three convolution layers in sequence; the Res4 layer and the Res5 layer are both 3D convolution layers; wherein the size of the first convolution layer is 3*1*1, the size of the second convolution layer is 1*3*3, and the sizes of the third convolution layer and the fourth convolution layer are both 1*1*1; the behavior classification layer is a fully connected layer; The environmental factor control module includes a temperature control unit, a humidity control unit and a harmful gas control unit.

2. The method for controlling the breeding environment based on environmental characteristics and pig behavior characteristics according to claim 1, characterized in that: The environmental prediction data for the next hour in step S4 includes temperature data, humidity data, ammonia data and data; The step S4 further comprises: S4-1, input the preprocessed environmental data set into the LSTM neural network to obtain the corresponding primary environmental sequence information; S4-2, input the environment sequence information into the attention mechanism module to obtain the corresponding importance score; assign different weights to the environment sequence information according to the importance score to obtain secondary environment sequence information; S4-3, input the secondary environmental sequence information into the series-connected GRU neural network in sequence for prediction, and obtain the environmental prediction data for the next 1 hour.

3. The breeding environment control method based on environmental characteristics and pig behavior characteristics according to claim 2 is characterized in that: The step S5 further comprises: S5-1, detect the current pig video data through the Faster-Rcnn network model, and use the DeepSort algorithm to track the pig detection results to obtain the corresponding pig positioning information; S5-2, according to the sampling interval , The current pig video data is sampled respectively to obtain low-frame pig data and high-frame pig data; S5-3, inputting the low-frame pig data and the high-frame pig data into the corresponding DropRes2 block respectively, obtaining a low-frame pig spatiotemporal behavior feature vector and a high-frame pig spatiotemporal behavior feature vector; S5-4, input the primary high-frame pig spatiotemporal behavior feature vector into the corresponding DropRes3 block to obtain the secondary high-frame pig spatiotemporal behavior feature vector; input the primary high-frame pig spatiotemporal behavior feature vector and the primary low-frame pig spatiotemporal behavior feature vector into the corresponding DropRes3 block after dimension conversion to obtain the secondary low-frame pig spatiotemporal behavior feature vector; S5-5, input the secondary high-frame pig spatiotemporal behavior feature vector into the corresponding Res4 layer to obtain the tertiary high-frame pig spatiotemporal behavior feature vector; input the secondary high-frame pig spatiotemporal behavior feature vector into the corresponding Res4 layer after dimension conversion and the secondary low-frame pig spatiotemporal behavior feature vector to obtain the tertiary low-frame pig spatiotemporal behavior feature vector; S5-6, input the three high-frame pig spatiotemporal behavior feature vectors into the corresponding Res5 layer to obtain the four high-frame pig spatiotemporal behavior feature vectors; input the three high-frame pig spatiotemporal behavior feature vectors into the corresponding Res5 layer after dimension conversion and the three low-frame pig spatiotemporal behavior feature vectors to obtain the four low-frame pig spatiotemporal behavior feature vectors; S5-7, splicing the four high-frame pig spatiotemporal behavior feature vectors and the four low-frame pig spatiotemporal behavior feature vectors to obtain a spliced ​​pig spatiotemporal behavior feature vector; S5-8, inputting the spliced ​​pig spatiotemporal behavior feature vectors into the BERT network model for feature fusion to obtain fused pig spatiotemporal feature data; S5-9, input the fused spatiotemporal feature data of the pigs into the behavior classification layer, and classify them in combination with the pig positioning information to obtain the classified pig behavior data; wherein the pig behavior data includes resting behavior data, eating behavior data and activity behavior data, the resting behavior data includes side-lying behavior data and curled-up behavior data, the eating behavior data includes eating behavior data and drinking behavior data, and the activity behavior data includes fighting behavior, standing behavior and walking behavior; S5-10. Input the classified pig behavior data into the pig behavior analysis submodule, count the time proportion of all behaviors of each pig in the current hour, average the time proportion of all behaviors of all individual pigs to obtain the time proportion of all behaviors of the entire pig group, and obtain the pig behavior proportion data ; S5-11. Divide the day into different time periods according to the different levels of activity of the pigs, and obtain the rest behavior stages respectively. , eating behavior stage and activity behavior stage ;in, , and are the total number of time periods corresponding to the resting behavior stage, the eating behavior stage, and the active behavior stage, respectively, and , For each time period of the rest behavior stage, For each time period of the eating behavior stage, The various time periods of the activity behavior phase; S5-12. Count the pig behavior data from the previous day to obtain the behavior percentage data of different behavior stages; S5-13, according to the behavior proportion data of different behavior stages in step S5-11 and different behavior stages in step S5-12, the current pig herd is processed to obtain the pig herd's perception data of the current temperature, humidity and harmful gas concentration, that is, the pigs' perception data of the current environment; wherein the harmful gas concentration includes the concentration and ammonia concentration in the house.

4. The method for controlling the breeding environment based on environmental characteristics and pig behavior characteristics according to claim 3, characterized in that: The behavior proportion data of different behavior stages in step S5-12 include the behavior proportion data of the resting behavior stage, the behavior proportion data of the eating behavior stage and the behavior proportion data of the active behavior stage; the behavior proportion data of the resting behavior stage includes the behavior proportion corresponding to the highest temperature moment of the pig herd in all resting behavior stages , The proportion of behaviors corresponding to the moment of lowest temperature , The proportion of behaviors corresponding to the highest relative humidity , the proportion of behaviors corresponding to the moment of lowest relative humidity The proportion of behaviors corresponding to the moment when the harmful gas concentration is the highest The behavior proportion data of the feeding behavior stage includes the behavior proportion corresponding to the highest temperature moment of the pig herd in all feeding behavior stages , The proportion of behaviors corresponding to the moment of lowest temperature , The proportion of behaviors corresponding to the highest relative humidity , the proportion of behaviors corresponding to the moment of lowest relative humidity The proportion of behaviors corresponding to the moment when the harmful gas concentration is the highest The behavior proportion data of the activity behavior stage includes the behavior proportion corresponding to the highest temperature moment of the pig herd in all activity behavior stages , The proportion of behaviors corresponding to the moment of lowest temperature , The proportion of behaviors corresponding to the highest relative humidity , the proportion of behaviors corresponding to the moment of lowest relative humidity The proportion of behaviors corresponding to the moment when the harmful gas concentration is the highest .

5. The method for controlling the breeding environment based on environmental characteristics and pig behavior characteristics according to claim 4, characterized in that: The step S5-13 further comprises: S5-13-1, determine whether the current pig herd is in the resting behavior stage; if so, proceed to step S5-13-2; otherwise, proceed to step S5-13-5; S5-13-2. Current pig behavior data The proportion of behaviors corresponding to the moment of highest temperature , The proportion of behaviors corresponding to the moment of lowest temperature Perform similarity calculation and make judgments. If the current pig behavior accounts for the data Proportion of behavior The similarity is greater than the current pig behavior proportion data Proportion of behavior If the similarity is , the current pigs’ perception of temperature is judged to be hot; otherwise, the current pigs’ perception of temperature is judged to be cold, that is, the perception data of the current temperature by the pigs in the resting behavior stage is obtained; S5-13-3. Current pig behavior data The proportion of behaviors corresponding to the highest relative humidity moment , the proportion of behaviors corresponding to the moment of lowest relative humidity The same processing method as step S5-13-2 is used to obtain the current humidity perception data of the pigs, that is, the data of whether the current humidity is perceived as high or low by the pigs in the resting behavior stage is obtained; S5-13-4. Current pig behavior data The proportion of behaviors corresponding to the moment with the highest concentration of harmful gases Perform similarity calculation. If the corresponding similarity is greater than the threshold value of 0.8, it is determined that the pigs' perception of the current concentration of harmful gases is too high. Otherwise, it is determined that the pigs' perception of the current concentration of harmful gases is too low. That is, the perception data of the pigs in the resting behavior stage on the current concentration of harmful gases is obtained. S5-13-5. Use the same processing method as steps S5-13-2 to S5-13-4 to obtain the perception data of the current temperature of the pigs in the active behavior stage, the perception data of the current humidity of the pigs in the active behavior stage, and the perception data of the current concentration of harmful gases of the pigs in the active behavior stage, or obtain the perception data of the current temperature of the pigs in the eating behavior stage, the perception data of the current humidity of the pigs in the eating behavior stage, and the perception data of the current concentration of harmful gases of the pigs in the eating behavior stage.

6. The method for controlling the breeding environment based on environmental characteristics and pig behavior characteristics according to claim 5, characterized in that: The step S6 further comprises: S6-1, input the pigs' perception data of the current temperature and the temperature data of the next hour into the temperature control unit, determine the size of the current temperature and the temperature data of the next hour, and control the temperature according to the pigs' perception data of the current temperature; S6-2, input the pigs' perception data of the current humidity and the humidity data for the next hour into the humidity control unit, determine the magnitude of the current humidity and the humidity data for the next hour, and control the humidity according to the pigs' perception data of the current humidity; S6-3. The pigs’ perception data of the current harmful gas concentration and the ammonia data for the next hour. The data is input into the harmful gas control unit, which controls the harmful gas concentration according to the harmful gas concentration in the next hour, the current harmful gas concentration and the current pig herd's perception data of the harmful gas concentration.

7. The method for controlling the breeding environment based on environmental characteristics and pig behavior characteristics according to claim 6, characterized in that: The specific process of step S6-1 is as follows: If the pigs perceive the current temperature as being too hot, determine whether the current temperature is lower than the temperature data for the next hour. If so, turn on the cooling mechanism of the pig farm and cool the farm in advance. Otherwise, do not adjust the temperature for the time being. If the pigs perceive the current temperature as being cold, then determine whether the current temperature is greater than the temperature data for the next hour. If so, turn on the pig farm's heating mechanism and heat the farm in advance. Otherwise, do not regulate it for the time being. The specific process of step S6-2 is as follows: If the pigs' perception of the current humidity is too high, it is determined whether the current humidity is lower than the humidity data for the next hour for two consecutive times. If so, the fan is turned on for ventilation, otherwise no control is performed for the time being. If the pigs' perception of the current humidity is low, it is determined whether the current humidity is greater than the humidity data for the next hour for two consecutive times. If so, the water curtain is opened, otherwise no regulation is temporarily performed; The specific process of step S6-3 is as follows: If the ammonia data for the next hour and If the concentration of the data is greater than the normal standard or the pigs' perception of the current harmful gas concentration is high for two consecutive times and the cumulative value exceeds two times, the fan will be turned on for ventilation, otherwise no regulation will be made temporarily; After ventilation control has been carried out at the current moment, if the pig herd's perception data of harmful gas concentration is still too high at the next moment, an early warning will be triggered and the staff will be notified to carry out inspection and control.

8. A breeding environment control system based on the breeding environment control method based on environmental characteristics and pig behavior characteristics according to any one of claims 1 to 7, characterized in that: It includes data acquisition module, data preprocessing module, environmental factor prediction module, pig behavior analysis module and environmental factor control module; among which: Data collection module, used to collect and store pig farm environmental factor data and pig video data every hour; A data preprocessing module is used to preprocess the pig farm environmental factor data and pig video data to obtain a preprocessed environmental data set; The environmental factor prediction module is used to obtain the environmental prediction data for the next hour using the preprocessed environmental data set; The pig behavior analysis module is used to analyze the pig video data and the current environmental factor data to obtain the pig's perception data of the current environment; The environmental factor control module is used to regulate the pig house environment based on the pigs' perception data of the current environment and the environmental prediction data for the next hour.

Citation Information

Patent Citations

  • Method for predicting dynamic changes of multiple environmental factors in pig house

    CN111368975A

  • Pig house environment sensing regulation and control method and system based on informatization

    CN116957169A