CN115914560A - Intelligent accurate feeding method and device for sows, electronic equipment and storage medium - Google Patents

Intelligent accurate feeding method and device for sows, electronic equipment and storage medium Download PDF

Info

Publication number
CN115914560A
CN115914560A CN202211269285.XA CN202211269285A CN115914560A CN 115914560 A CN115914560 A CN 115914560A CN 202211269285 A CN202211269285 A CN 202211269285A CN 115914560 A CN115914560 A CN 115914560A
Authority
CN
China
Prior art keywords
image
data
target
pigs
pig
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211269285.XA
Other languages
Chinese (zh)
Inventor
李伟
谷育东
吕成军
王璐
王小林
邰伟鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Anhui University Of Technology Science Park Co ltd
Original Assignee
Anhui University Of Technology Science Park Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui University Of Technology Science Park Co ltd filed Critical Anhui University Of Technology Science Park Co ltd
Priority to CN202211269285.XA priority Critical patent/CN115914560A/en
Publication of CN115914560A publication Critical patent/CN115914560A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P60/00Technologies relating to agriculture, livestock or agroalimentary industries
    • Y02P60/80Food processing, e.g. use of renewable energies or variable speed drives in handling, conveying or stacking
    • Y02P60/87Re-use of by-products of food processing for fodder production

Abstract

The invention discloses an intelligent and accurate feeding method and device for sows, electronic equipment and a storage medium. According to the invention, by combining intelligent and automatic technologies and depending on intelligent detection equipment and an automatic feeding device, the body temperature, the food intake and the most key backfat parameters of the sows at different periods are recorded and monitored, the health condition of the sows is strictly monitored, the quality of the sows and the piglets is accurately controlled, and the technical effects of improving the cultivation mechanization degree and reducing the cultivation cost are achieved.

Description

Intelligent accurate feeding method and device for sows, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of computer science, in particular to an intelligent accurate feeding method and device for sows, electronic equipment and a storage medium.
Background
With the development of livestock breeding industries at home and abroad, the artificial breeding mode is gradually close to the bottleneck, the breeding cost is continuously increased, the price fluctuation of live pigs is large, and in addition, due to the influence of swine fever in two years, the stock quantity of the bred pigs in China is sharply reduced, the price rise of pork is obvious, so that the breeding cost is reduced from the breeding level of sows. The mechanization level of the domestic pig breeding industry in China is only 30%, the efficiency of traditional artificial feeding is not high, and although the price falls back to some extent due to national relevant policies, the cost is still obviously higher than that of the past year. Compared with developed countries such as the United states, canada and European Union, the modernized breeding industry of China just starts. At present, research on modern sow breeding, including pig face recognition, pig behavior tracking, sow oestrus monitoring and the like, is widely carried out by many foreign college researches and large-scale companies.
At present, the sow can be bred in a key period of restoring and maintaining the productivity of the sow, and the sow can be bred, so that the quantity of the sow can return to normal, and the quality of the sow can be broken through. The sow is used as the most important production tool of a large-scale pig farm, the reproductive performance of the sow is particularly critical, and the sow is the basis of the profit of the pig farm. At present, in the breeding industry, a method for feeding pigs one by adopting positioning fences is adopted, so that the management is facilitated, the protection on sows is improved, and meanwhile, an independent trough is arranged in each positioning fence, so that the targeted feeding is performed according to different growth and development stages of the sows. 2020. The breeding potential of sows in China is about 4000 ten thousand in year, the production situation of live pigs is generally stable, the breeding potential of live pigs is good, the breeding potential of live pigs is stable, the breeding potential of live pigs is still far less than that of developed countries such as Europe and America, and the breeding potential of sows in China is huge and the investment value is high.
Disclosure of Invention
The invention aims to provide an intelligent and accurate sow feeding method, an intelligent and accurate sow feeding device, electronic equipment and a storage medium, which are used for solving the technical problems of high live pig breeding cost and low breeding mechanization degree in the prior art, so that the technical effects of improving the breeding mechanization degree and reducing the breeding cost are achieved.
In order to achieve the above purpose, the invention provides the following scheme:
in a first aspect, the invention provides an intelligent and accurate feeding method for sows, which comprises the following steps:
at fixed time intervals Δ T 1 Synchronously acquiring images in the positioning columns of the pigs and measuring the body temperature of the pigs to obtain the images and the temperature data of the pigs;
preprocessing the image to improve the image data characteristics;
performing target feature recognition on the preprocessed image, judging whether complete target image features exist or not, and if the complete target image features exist, extracting target feature data in the image;
calculating target data corresponding to the image according to the target image characteristic data;
and processing the temperature data and the target data of the pigs to obtain the feed input amount, and sending a feeding instruction to the electronic feeder according to the feed input amount.
Further, the image is preprocessed to improve the image data characteristics, and the method comprises the following steps:
performing gray processing, wherein the gray processing respectively grays the image by adopting a maximum value method and a weighted average value method, processes the RGB value of each pixel point into the same value, respectively obtains a first RGB value and a second RGB value, the RGB value of the image is the mean value of the first RGB value and the second RGB value, and the grayed image is changed into a single channel from three channels to obtain a gray image;
and a filtering process of performing weighted average of the entire image by convolution using convolution to scan each pixel in the image that has undergone gradation processing.
Further, performing target feature recognition on the preprocessed image, judging whether complete target image features exist, and if the complete target image features exist, extracting target feature data in the image, including:
detecting the image by using a Haar classifier;
using Haar-like characteristics to carry out characteristic detection, sequentially detecting whether a target complete image exists, and if so, marking a region corresponding to the characteristics;
and judging whether the detection result has complete image characteristics, and if so, extracting target characteristic data in the image.
Further, the target comprises a pig and/or a trough and/or a positioning bar, and the target data comprises the weight of the pig and/or the trough residue.
Further, matching the target image feature data with a preset feature weight model, and calculating to obtain target data corresponding to the image, including:
calculating the weight of the pig;
calculating characteristic data in a preset sample through least square regression calculation to obtain a weight model corresponding to the weight or the trough of the pig, and performing linear fitting on the image characteristic sample to obtain the weight model:
h α (x 1 ,x 2 ,...x n )=α 1 x 1 +...+α n x n
wherein alpha is i (i =1,2.. N) is a model parameter, x i N) is the n characteristic values of each sample;
establishing a loss function:
Figure BDA0003894523110000031
alpha in a model of the weight of an object by a loss function i (i = 1.. N) is derived and let the derivative be 0, which can be:
Figure BDA0003894523110000032
obtaining a pig target weight model parameter alpha i A value of (i =1,2.. N);
obtaining weight data of the pigs according to the characteristic data of the pigs and the weight model of the pigs;
calculating the trough allowance y i
The trough image characteristic data comprises a trough excess area s i Height h of excess material in material mixing groove and height h of excess material in each section of material mixing groove equally divided into n sections i Then, then
Figure BDA0003894523110000033
Wherein rho is the average density of the feed.
Further, handle target data, obtain fodder input volume, according to fodder input volume sends the instruction of throwing materials to electronic feeding ware, include:
receiving pig weight data, trough excess material data and pig body temperature data in the target data, and defining the feed input amount as f j
Figure BDA0003894523110000034
Wherein, theta i 、y i And P i Respectively the weight of the pigs, the excess feed of the trough and the body temperature of the pigs;
and calculating the current feed putting amount, and sending a feeding instruction to the electronic feeder according to the feed putting amount data.
Further, the method further comprises:
comparing the pig body temperature data in the target data with the body temperature data of the sow in the growth stage, and judging whether the pig has an overtemperature phenomenon;
analyzing and calculating the temperature of each pair of pigs with the same column after n (n < 10) times of continuous temperature acquisition, and taking average data;
obtaining the body temperature t of the pig j The parameters are as follows:
Figure BDA0003894523110000041
if the body temperature parameter is larger than the over-temperature threshold value L, judging that the body temperature of the pig is over-temperature, and sending an alarm instruction.
In a second aspect, the invention provides an intelligent and accurate feeding device for sows, which comprises the following modules:
a data acquisition module for a fixed time interval Δ T 1 Synchronously acquiring images in the positioning columns of the pigs and measuring the body temperature of the pigs to obtain the images and the temperature data of the pigs;
the image preprocessing module is used for preprocessing the image and improving the image data characteristics;
the image processing module is used for carrying out target feature identification on the preprocessed image, judging whether complete target image features exist or not, and extracting target feature data in the image if the complete target image features exist;
the first data processing module is used for calculating target data corresponding to the image according to the target image characteristic data;
and the second data processing module is used for processing the temperature data and the target data of the pigs to obtain the feed input amount, and sending a feeding instruction to the electronic feeder according to the feed input amount.
In a third aspect, the present invention also provides an electronic device comprising a processor, a memory and a computer program stored on the memory, the computer program being executed by the processor when the computer program is executed to implement the method as described above.
In a fourth aspect, the present invention also provides a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the method as described above.
Has the advantages that:
according to the technical scheme, the intelligent precise feeding method, the intelligent precise feeding device, the electronic equipment and the storage medium are provided, the intelligent and automatic technology is combined, the body temperature, the food intake and the most key backfat parameter of the sows at different periods are recorded and monitored by means of the intelligent detection equipment and the automatic feeding device, the health condition of the sows is strictly monitored, the quality of the sows and the qualities of the piglets are precisely controlled, the problems that pigs in a farm are large in number, the feeding process before, during and after birth is complex and data are huge are solved, and a large amount of data can be used as a strong database to support, so that the intelligent equipment can more accurately judge the health condition of the pigs, accurately feed according to different periods, meanwhile, the artificial recording detection and feeding can be replaced, the cost is reduced, manpower is saved, and the technical effects of improving the mechanical degree of breeding and reducing the breeding cost are achieved.
It should be understood that all combinations of the foregoing concepts and additional concepts described in greater detail below can be considered as part of the inventive subject matter of this disclosure unless such concepts are mutually inconsistent.
The foregoing and other aspects, embodiments and features of the present teachings can be more fully understood from the following description taken in conjunction with the accompanying drawings. Additional aspects of the present invention, such as features and/or advantages of exemplary embodiments, will be apparent from the description which follows, or may be learned by practice of specific embodiments in accordance with the teachings of the present invention.
Drawings
The figures are not intended to be drawn to scale. In the drawings, each identical or nearly identical component that is illustrated in various figures may be represented by a like numeral. For purposes of clarity, not every component may be labeled in every drawing. Embodiments of various aspects of the present invention will now be described, by way of example, with reference to the accompanying drawings, in which:
FIG. 1 is a schematic flow chart of a method in an embodiment of the present application;
fig. 2 is a scene schematic diagram suitable for the sow intelligent accurate feeding method provided in the embodiment of the application.
Detailed Description
In order to make the purpose and technical solution of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention without inventive step, are within the scope of protection of the invention.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The invention is combined with intelligent and automatic technologies, realizes the recording and monitoring of the body temperature, the food intake and the most key backfat parameter of the sows at different growth stages by depending on intelligent detection equipment and an automatic feeding device, strictly monitors the health condition of the sows, accurately controls the quality of the sows and the piglets, can replace manual recording detection and feeding, reduces the cost and saves the labor.
The invention provides an intelligent precise feeding method and device for sows, electronic equipment and a storage medium, which are respectively explained in detail below.
Example one
The embodiment of the invention provides an intelligent feeding method for sows, which is described from the perspective of an intelligent accurate feeding device for facilitating understanding, wherein the intelligent accurate feeding device can be respectively integrated in an image acquisition device, a body temperature acquisition device, a feeding device and an alarm device.
As shown in fig. 1, an intelligent precise feeding method for sows comprises the following steps:
step S101, at a fixed time interval Delta T 1 Synchronously acquiring images in the positioning columns of the pigs and measuring the body temperature of the pigs to obtain the images and the temperature data of the pigs;
step S102, preprocessing the image to improve the image data characteristics;
step S103, carrying out target feature recognition on the preprocessed image, judging whether complete target image features exist or not, and extracting target feature data in the image if the complete target image features exist;
step S104, calculating target data corresponding to the image according to the target image characteristic data;
step S105, processing the temperature data and the target data of the pigs to obtain the feed input amount, and sending a feed feeding instruction to an electronic feeder according to the feed input amount;
as shown in the figure I, the intelligent and accurate sow feeding method comprises the following specific processes:
step S101, at a fixed time interval Delta T 1 Synchronously acquiring images in a pig positioning fence and measuring the body temperature of the pig to obtain images and pig temperature data, for example, as shown in fig. 2, a hanging rail can be provided on the ceiling of a pig house, a rail robot can horizontally move at a constant speed on the hanging rail, wherein the rail robot is attached with an image acquisition device and a body temperature acquisition device which are respectively and simultaneously at a fixed time interval delta T 1 Images and body temperature were collected only for pigs. The collector is provided with a three-dimensional mechanical arm, and can collect the body temperature and the image characteristics of the pig at any angle within a certain distance range.
Under normal conditions, the body temperature of the sow is kept at about 38-39.5 ℃, and the body temperature is increased by 1-2 ℃ in the estrus period; the body temperature is reduced by 0.5 to 1 ℃ during ovulation, and the body temperature is increased by 0.3 to 0.5 ℃ after ovulation; the body temperature rises from 10-11 days after mating to 39.0 deg.C or above and continues for 18 days from 38.3 deg.C before 10 days, and then falls below 39.0 deg.C.
At equal time intervals Δ T 1 And actively carrying out temperature acquisition on the target object. Each pair of pigs in the same column is only continued for n times (n)<10 Analysis and calculation are carried out after temperature acquisition, average data is taken, and the temperature t of the pig is obtained after calculation j The parameters are as follows:
Figure BDA0003894523110000071
s102, preprocessing an image to improve the data characteristics of the image; for the acquired pig image, the image needs to be preprocessed before the pig image is identified, so that the influence of external factors on characteristic data is avoided, and the image preprocessing process comprises gray processing and filtering processing:
and (3) gray level processing, wherein the acquired pig image is a color image, so that the image needs to be subjected to gray level processing firstly and converted into a gray level image. In some common image gray scale processing methods, the image processed by the maximum method is too bright, and the image processed by the average method is too dark, so that the two methods are combined to average the calculated RGB values.
In this embodiment, the image is processed by using a weighted average method and a maximum value method, wherein the weighted average method performs weighted average on the three components with different weights according to importance and other indexes, and since human eyes have the highest sensitivity to green and the lowest sensitivity to blue, the formula for converting the original color image data into a gray scale map is as follows:
Gray=0.298·R+0.598·G+0.104·B
wherein a second RGB value is obtained;
wherein Gray is the converted Gray image, and R, G, and B represent red, green, and blue components in the color image, respectively.
In addition, the R, G, B value after the image graying by the maximum value method for the grayscale processing is equal to the maximum one of the 3 values before the conversion, that is:
r = G = B = max (R, G, B), resulting in a first RGB value;
taking the average value of the first RGB value and the second RGB value as the final RGB value of the image;
the grayed image is changed from three channels to a single channel, and the calculation amount required by a subsequent recognition algorithm can be reduced;
in the filtering process, the gray-scale image obtained after the gray-scale process may have noise such as dust, which may interfere with the subsequent recognition of the image characteristics, so that the filtering and noise reduction process needs to be performed on the image. In this embodiment, a gaussian filtering process is performed on a grayscale image, a 3 × 3 gaussian filter template is defined, sampling is performed by using the central position of the template as a coordinate origin, and coordinates of the template at each position are as follows:
(-2,-1)(-1,0)(0,0)
(-2,-1)(-1,-1)(0,-1)
(-2,0)(-1,-2)(0,-2)
the coordinates of each position are brought into a Gaussian function, the obtained value is the coefficient of the template, and the calculation formula of each element value in the template is as follows:
Figure BDA0003894523110000081
where (x, y) is the pixel coordinates of the image, which can be considered as an integer in the image processing, and σ is the standard deviation.
The template coefficient obtained by calculation can be used for performing convolution filtering operation on the image and removing noise points in the image, so that the filtered and denoised image is obtained, and the accuracy of subsequent identification is improved.
Step S103, carrying out target feature recognition on the preprocessed image, judging whether complete target image features exist or not, if so, extracting target feature data in the image, wherein the target comprises a pig and/or a trough and/or a positioning column, the target data comprises the weight of the pig and/or excess material of the trough, and the feature recognition of the pig and the trough is respectively explained as follows:
after the filtered pig image is obtained, feature recognition needs to be carried out on the pig image, whether complete backfat features and location bar features exist in the image or not is judged, if no features or no complete features exist, it is indicated that complete feature data cannot be extracted from the pig image, and due to the fact that subsequent pig body weight recognition needs to be carried out according to the feature data, the accuracy of weight recognition is possibly reduced due to the fact that the feature data are incomplete, subsequent pig body weight recognition processing is not carried out on the image, and the accuracy of a pig body weight measurement algorithm is improved while the calculation amount of the algorithm is reduced.
In this embodiment, a Haar classifier in OpenCV is used to detect the pig image, and the third specific process of the step includes:
training a Haar classifier, wherein the specific training process is as follows:
(1) Creating positive samples of Haar classifiers:
(1) respectively capturing a backfat area picture and a positioning fence area picture of the pig from the 1000 complete sample pictures of the same variety of pigs with the weight to be estimated;
(2) after the image is cut out, adjusting the image pixel size of the positive sample to 24 multiplied by 24;
(3) a positive sample is generated.
In this embodiment, the description file format of the positive sample is: adding a picture suffix, a blank space, a contained feature number and position information of the picture on a two-dimensional coordinate to the picture name, taking the sample as an example: image1.Jpg 100 23.
(2) Creating negative examples of Haar classifiers:
the specific requirements of the negative sample are: the negative examples can be from any pictures, but the pictures can not contain the target features, the negative examples are described by a background description file, the background description file is a text file, and each line contains the file name of one negative example picture.
(3) Training a Haar classifier:
the opencv _ traincascade module in opencv is used for training.
(4) Creating Haar classifier training samples:
detecting the pig images by using a Haar classifier, sequentially detecting whether the pig backfat images and the positioning bar images exist, and marking the areas corresponding to the features in the images if the pig backfat images and the positioning bar images exist.
Specifically, key areas of the pictures are sequentially identified and marked, and whether backfat characteristics and location bar characteristics are detected or not is judged. If no feature is detected when any feature in the steps is carried out, the picture is not subjected to the next detection, and the calculation amount is reduced; if a feature is detected, the corresponding region is marked in the image.
The specific detection and labeling process described above comprises the steps of:
(1) detecting whether a positioning bar region exists in the acquired image or not by using a Haar classifier for monitoring the characteristics of the positioning bar, if so, marking the left upper end of the positioning bar region as L1, the right upper end as L2, the left lower end as L3 and the right lower end as L4;
(2) and (3) on the basis that the positioning bar is successfully detected in the step (1), using a Haar classifier for detecting backfat characteristics to check whether backfat areas exist among the positioning bar areas L1, L2, L3 and L4 in the step (1), and if so, marking the leftmost end position of backfat to be L5 and the rightmost end to be L6.
Judging whether the detection result has complete backfat characteristics, if so, extracting the characteristic data in the image of the pig, and specifically comprising the following steps:
the existence of complete pig features refers to that the pig image comprises four corners of the positioning column, namely the upper left corner, the upper right corner, the lower left corner and the lower right corner, and the backfat is at the leftmost end and the rightmost end, after the detection of the image is finished, whether complete features exist in the detection result is judged, if complete features exist, feature data are extracted according to the marked regions in the image, and the feature data are distances among key point regions L1, L2, L3, L4, L5 and L6 which are detected and marked in the previous step and are used for subsequent weight matching identification of pigs; if not, the image is not processed. The feature data described in this embodiment includes the following feature data of 9 pigs:
the distance from the upper left corner L1 to the upper right corner L2 of the positioning column is marked as a characteristic 1; the distance from the lower left corner L3 to the lower right corner L4, labeled feature 2; the distance from the upper left corner L1 to the lower left corner L3 is marked as feature 3; the distance from the upper right corner L2 to the lower right corner L4 is marked as feature 4; the distance from the leftmost end L5 to the rightmost end L6 of the backfat is marked as feature 5; the vertical distance from feature 3 to the leftmost end L5 of the backfat, labeled as feature 6; the vertical distance from feature 4 to the far right end L6 of the backfat is marked as feature 7; the vertical distance from feature 1 to feature 3, labeled feature 8; the vertical distance of feature 2 to feature 3 is labeled feature 9.
All the distances are Euclidean distances between the pixel points, and the expression of the Euclidean distances is as follows:
Figure BDA0003894523110000111
after the filtered silo image is obtained, feature recognition needs to be carried out on the image, whether complete silo features exist in the image is judged, if no features exist or no complete features exist, it is indicated that complete feature data cannot be extracted from the silo image, due to the fact that follow-up silo excess material recognition needs to be carried out according to the feature data, the accuracy of excess material recognition is possibly reduced due to the fact that the feature data are incomplete, follow-up silo recognition processing is not carried out on the image, and the accuracy of the silo excess material measurement algorithm is improved while the calculation amount of the algorithm is reduced. In this embodiment, a Haar classifier in OpenCV is used to detect the trough image, the process is similar to the above feature recognition of the middle pig, and the process specifically includes:
training a Haar classifier; the specific training process is as follows:
(1) Creating positive samples of a Haar classifier;
(2) Creating negative samples of a Haar classifier;
(3) Training a Haar classifier;
(4) Creating Haar classifier training samples:
and detecting the trough images by using a Haar classifier, and sequentially detecting whether the trough images exist. If so, marking the area corresponding to the feature in the image.
In the monitoring and marking process, if a trough area exists in the acquired image, the left upper end of a marking trough is L1, the right upper end of the marking trough is L2, the left lower end of the marking trough is L3, and the right lower end of the marking trough is L4; when the feed area is marked, the scattering of the feed is irregular, so that a plurality of vertexes of the feed area are marked as L5, L6 \8230, 8230and Ln, and the maximum number of vertexes is not more than eight.
When the characteristics are marked, the distance from the upper left corner L1 to the upper right corner L2 of the trough in the image is marked as characteristic 1; the distance from the lower left corner L3 to the lower right corner L4, labeled feature 2; the distance from the upper left corner L1 to the lower left corner L3 is marked as feature 3; the distance from the upper right corner L2 to the lower right corner L4 is marked as feature 4;
when the excess material characteristic is marked, the distance between the mark points L5 and L6 is marked as the characteristic 5, the distance between the mark points L6 and L7 is marked as the characteristic 6, and the like, and the distance between the mark points Ln and Ln-1 is marked as the characteristic n.
All the distances are Euclidean distances between the pixel points, and the expression of the Euclidean distances is as follows:
Figure BDA0003894523110000121
step S104, calculating target data corresponding to the image according to the target image characteristic data, wherein similarly, the target comprises a pig and/or a trough and/or a positioning bar, the target data comprises the weight of the pig and/or excess material of the trough, and the calculation of the pig and the trough adopts different calculation methods, which are respectively explained below.
Matching the pig image feature data with a preset feature weight model, and calculating to obtain pig weight data corresponding to the pig image, wherein the specific process is as follows:
1. calculating characteristic data in a preset sample through least square regression calculation to obtain a weight model of the corresponding pig;
and calculating the weight of the target pig according to the characteristic data and the weight model.
Specifically, because the back fat thickness of the pig increases linearly along with the weight of the pig, a plurality of groups of back fat and positioning bar characteristic data can be obtained by processing the preset sample in the steps, and the characteristic data are calculated to obtain a weight model with universal applicability for measuring the weight of the pig. Compared with the traditional weighing cage, weighing vehicle and weight measuring ruler, the method for measuring the weight of the pig provided by the embodiment does not need manual participation, only needs to identify and detect the image of the target pig to obtain the backfat characteristic and the location bar characteristic data of the pig, and matches the characteristic data with the weight model to obtain the weight of the target pig, so that the labor cost is reduced, and the production efficiency is improved. The method comprises the following steps of calculating pig characteristic data in complete sample picture data of 1000 pigs with the same species and weight to be estimated through least square regression to obtain a weight model corresponding to the weight of the pig, and specifically comprises the following steps:
carrying out linear fitting on the image characteristic sample to obtain a weight model:
hα(x1,x2,...xn)=α1x1+...+αnxn
wherein α i (i =1,2.. N) is a model parameter, xi (i =1,2.. N) is n feature values of each sample;
establishing a loss function:
Figure BDA0003894523110000131
by deriving the fitted function by a loss function with α i (i = 1.. N) and letting the derivative be 0, one can obtain:
Figure BDA0003894523110000132
obtaining an n + 1-element linear equation set through the calculation, wherein the equation set comprises n +1 equations, solving the equation set to obtain n +1 unknown alpha, and the alpha is the unknown alphaThe corresponding weight values, n +1 α, are model parameters α in the weight model i (i =1,2.. N), also referred to as weight parameter. In this embodiment, n takes the value of 9, which corresponds to the above 9 features. The resulting weight model is as follows:
h α (x 1 ,x 2 ,...x 9 )=α 1 x 1 +...+α 9 x 9
wherein alpha is i (i =1,2.. 9) is the weight parameter value, x i (i =1,2.. 9) are 9 feature values for each sample.
2. And calculating the weight of the target pig according to the characteristic data and the weight model of the pig.
Specifically, in this embodiment, the 9 features extracted in the previous step are matched with the weight model obtained according to the preset sample, and the weight of the target pig is finally obtained.
The process of calculating the trough allowance is as follows:
the width of the trough in the image is equally divided into n sections, and the height of the residual material in each section is marked as h j Carrying out weighted average processing on the height of the excess materials to obtain the average height of the excess materials;
the excess material area s of the trough is acquired by the image acquisition equipment of the track robot i And calculating the feed allowance by combining the average height and the average density rho of the feed to obtain the feed groove allowance y i:
Figure BDA0003894523110000133
Step S105, processing the target data to obtain a feed input amount, and sending a feed input instruction to the electronic feeder according to the feed input amount, wherein the feed input instruction comprises the following specific steps:
feed delivery amount f j Depending on the current trough margin y i And the current growth condition of pigs theta i And health condition P i
Figure BDA0003894523110000141
The feeding instruction is sent after the feed feeding amount is obtained through the information processing in the steps, the feeding instruction receiving end can be an electronic feeder, the electronic feeder is installed on the outer side of a pigsty and close to the head direction of a sow, a feed conveying module is arranged inside a shell of the electronic feeder, the lower portion of the shell is connected with a feeding hopper, an instruction receiving module is arranged outside the feeding hopper, a signal receiving module controls a discharging gate, and the electronic feeder receives the feeding instruction and then feeds the feed according to the instruction data.
As shown in fig. 1, in this embodiment, the method further includes the following steps:
s1011, comparing the pig body temperature data in the target data with the body temperature data of the sow in the growth stage, wherein the pig body temperature data adopts the pig body temperature parameter t calculated in the step j Judging whether the pig has an overtemperature phenomenon or not;
and S1012, if the body temperature data and the body temperature of the pig exceed a preset threshold value L, sending an audible and visual alarm instruction, receiving the instruction by an alarm device, and sending an audible and visual alarm to remind a breeder to arrive at the site for further processing.
Example two
Correspondingly, the embodiment of the invention also provides an intelligent feeding device for sows, wherein the intelligent accurate feeding device can be respectively integrated in the image pickup equipment, the feeding equipment and the alarm equipment, the image pickup equipment can be a track robot, the feeding equipment can be an electronic feeder, and the alarm equipment can be an audible and visual alarm.
For example, the intelligent precise feeding method for the sows can be divided into a plurality of modules, the modules are stored in a memory, and the processor executes the method to complete the invention. The modules or units can be a series of computer program instruction segments capable of achieving specific functions, and the instruction segments are used for describing the implementation process of the intelligent precise feeding method for the sows. For example, the accurate feeding device of sow intelligence is cut apart into data acquisition module, image preprocessing module, image processing module, first data processing module and second data processing module, and the concrete function of each module is as follows:
a data acquisition module for a fixed time interval Δ T 1 Synchronously acquiring images in the positioning columns of the pigs and measuring the body temperatures of the pigs to obtain the images and the temperature data of the pigs;
the image preprocessing module is used for preprocessing the image and improving the image data characteristics;
the image processing module is used for carrying out target feature identification on the preprocessed image, judging whether complete target image features exist or not, and extracting target feature data in the image if the complete target image features exist;
the first data processing module is used for calculating target data corresponding to the image according to the target image characteristic data;
and the second data processing module is used for processing the temperature data and the target data of the pigs to obtain the feed input amount, and sending a feeding instruction to the electronic feeder according to the feed input amount.
Accordingly, embodiments of the present invention also provide an electronic device, comprising a processor, a memory, and a computer program stored on the memory, which when executed by the processor implements the method in any of the embodiments of the present invention.
These computer programs may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks, and corresponding steps may be implemented by different modules.
The programs described above may be run on a processor or may also be stored in memory (or referred to as computer-readable media), which includes both non-transitory and non-transitory, removable and non-removable media, that implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Embodiments of the present invention also provide a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the method in the above embodiments.
Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the protection scope of the present invention should be determined by the appended claims.

Claims (10)

1. An intelligent accurate feeding method for sows is characterized by comprising the following steps:
at fixed time intervals Δ T 1 Synchronously acquiring images in the positioning columns of the pigs and measuring the body temperature of the pigs to obtain the images and the temperature data of the pigs;
preprocessing the image to improve the image data characteristics;
carrying out target feature identification on the preprocessed image, judging whether complete target image features exist or not, and if the complete target image features exist, extracting target feature data in the image;
calculating target data corresponding to the image according to the target image characteristic data;
and processing the temperature data and the target data of the pigs to obtain the feed input amount, and sending a feeding instruction to the electronic feeder according to the feed input amount.
2. The intelligent and accurate feeding method for sows as claimed in claim 1, wherein the preprocessing of images to improve image data characteristics comprises:
performing gray processing, wherein the gray processing respectively grays the image by adopting a maximum value method and a weighted average value method, processes the RGB value of each pixel point into the same value to respectively obtain a first RGB value and a second RGB value, the RGB value of the image is the mean value of the first RGB value and the second RGB value, and the grayed image is changed into a single channel from three channels to obtain a gray image;
and a filtering process of performing weighted average of the entire image by convolution using convolution to scan each pixel in the image that has undergone gradation processing.
3. The intelligent and accurate feeding method for sows as claimed in claim 1, wherein the target feature recognition is performed on the preprocessed image, whether complete target image features exist is determined, and if complete target image features exist, target feature data in the image is extracted, comprising:
detecting the image by using a Haar classifier;
using Haar-like characteristics to carry out characteristic detection, sequentially detecting whether a target complete image exists, and if so, marking an area corresponding to the characteristics;
and judging whether the detection result has complete image characteristics, and if so, extracting target characteristic data in the image.
4. The intelligent and accurate feeding method for sows as claimed in claim 1, wherein said targets comprise pigs and/or silos and/or positioning fences, and said target data comprises pig weight and/or silo excess.
5. The intelligent and accurate feeding method for sows as claimed in claim 4, wherein calculating target data corresponding to the image according to said target image characteristic data comprises:
calculating the weight of the pig;
calculating the characteristic data of the pigs in the preset sample through least square regression calculation to obtain a weight model of the corresponding pigs:
h α (x 1 ,x 2 ,...x n )=α 1 x 1 +...+α n x n
wherein alpha is i (i =1,2.. N) is a model parameter, x i N) is the n characteristic values of each sample;
establishing a loss function:
Figure FDA0003894523100000021
alpha in a model of the weight of an object by a loss function i (i = 1.. N) is derived and let the derivative be 0, which can be:
Figure FDA0003894523100000022
/>
obtaining the weight model parameter alpha of the pig i A value of (i =1,2.. N);
obtaining weight data of the pigs according to the characteristic data of the pigs and the weight model of the pigs;
calculating the residual y of the material groove i
The trough image characteristic data comprises a trough excess area s i Height h of surplus material in material mixing groove and height h of surplus material in each section of material mixing groove equally divided into n sections i Then, then
Figure FDA0003894523100000023
Wherein rho is the average density of the feed.
6. The intelligent and accurate feeding method for the sows as claimed in claim 5, wherein the target data is processed to obtain a feed input amount, and a feeding instruction is sent to the electronic feeder according to the feed input amount, comprising:
receiving pig weight data, silo excess material data and pig body temperature data in the target data, and defining the feed input amount as f j
Figure FDA0003894523100000031
Wherein, theta i 、y i And P i Respectively the weight of the pigs, the excess feed of the trough and the body temperature of the pigs;
and calculating the current feed input amount, and sending a feed feeding instruction to the electronic feeder according to the feed input amount data.
7. The intelligent and accurate feeding method for sows as claimed in claim 1, wherein said method further comprises:
comparing the pig body temperature data in the target data with the body temperature data of the sow in the growth stage, and judging whether the temperature of the pig is over-high or not;
analyzing and calculating after continuously collecting n (n < 10) times of temperature of each pair of pigs with the same column, and taking average data;
obtaining the body temperature t of the pig j The parameters are as follows:
Figure FDA0003894523100000032
if the body temperature parameter is larger than the over-temperature threshold value L, judging that the body temperature of the pig is over-temperature, and sending an alarm instruction.
8. The utility model provides an accurate feeding device of sow intelligence which characterized in that includes following module:
a data acquisition module for a fixed time interval Δ T 1 Synchronously acquiring images in the positioning columns of the pigs and measuring the body temperature of the pigs to obtain the images and the temperature data of the pigs;
the image preprocessing module is used for preprocessing the image and improving the image data characteristics;
the image processing module is used for carrying out target feature identification on the preprocessed image, judging whether complete target image features exist or not, and extracting target feature data in the image if the complete target image features exist;
the first data processing module is used for calculating target data corresponding to the image according to the target image characteristic data;
and the second data processing module is used for processing the temperature data and the target data of the pigs to obtain the feed input amount, and sending a feeding instruction to the electronic feeder according to the feed input amount.
9. An electronic device, comprising a processor, a memory, and a computer program stored on the memory, the computer program being for implementing the method of any one of claims 1-7 by the processor when the computer program is executed.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
CN202211269285.XA 2022-10-17 2022-10-17 Intelligent accurate feeding method and device for sows, electronic equipment and storage medium Pending CN115914560A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211269285.XA CN115914560A (en) 2022-10-17 2022-10-17 Intelligent accurate feeding method and device for sows, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211269285.XA CN115914560A (en) 2022-10-17 2022-10-17 Intelligent accurate feeding method and device for sows, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115914560A true CN115914560A (en) 2023-04-04

Family

ID=86484096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211269285.XA Pending CN115914560A (en) 2022-10-17 2022-10-17 Intelligent accurate feeding method and device for sows, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115914560A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116363141A (en) * 2023-06-02 2023-06-30 四川省畜牧科学研究院 Pregnant sow intelligent body type evaluation device and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116363141A (en) * 2023-06-02 2023-06-30 四川省畜牧科学研究院 Pregnant sow intelligent body type evaluation device and system
CN116363141B (en) * 2023-06-02 2023-08-18 四川省畜牧科学研究院 Pregnant sow intelligent body type evaluation device and system

Similar Documents

Publication Publication Date Title
CN111339912B (en) Method and system for recognizing cattle and sheep based on remote sensing image
CN110754426B (en) Method and system for automatically detecting backfat body and automatically feeding animals
Zhang et al. Development and validation of a visual image analysis for monitoring the body size of sheep
CN110532899B (en) Sow antenatal behavior classification method and system based on thermal imaging
CN112000051A (en) Livestock breeding management system based on Internet of things
CN111767794A (en) Cage-rearing poultry abnormal behavior detection method and detection system based on machine vision
CN111161214B (en) System and method for measuring pig weight and identifying drinking behavior based on binocular vision
CN112526097A (en) Aquaculture water body environment intelligent monitoring management system based on big data analysis
CN109380146B (en) Automatic measurement device and method for live pigs
Lu et al. An automatic splitting method for the adhesive piglets’ gray scale image based on the ellipse shape feature
CN115914560A (en) Intelligent accurate feeding method and device for sows, electronic equipment and storage medium
CN110188657A (en) Corn arid recognition methods based on crimping blade detection
CN116034904A (en) Pig health monitoring system and method based on track type inspection robot
CN111797831A (en) BIM and artificial intelligence based parallel abnormality detection method for poultry feeding
CN115200647A (en) Aquaculture environment monitoring management method and system
CN112883915B (en) Automatic wheat head identification method and system based on transfer learning
CN113780207A (en) System and method for goat face recognition
CN113420709A (en) Cattle face feature extraction model training method and system and cattle insurance method and system
CN116295022A (en) Pig body ruler measurement method based on deep learning multi-parameter fusion
CN113658124B (en) Method for checking underwater culture assets
CN117036820B (en) Pig classification model based on visual image and method thereof
Bastiaansen et al. Continuous real-time cow identification by reading ear tags from live-stream video
CN116363141B (en) Pregnant sow intelligent body type evaluation device and system
CN117409403B (en) Rice spike maturity estimation method based on deep learning
CN117636314A (en) Seedling missing identification method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination