Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but should be considered part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
For the purposes of promoting an understanding of the principles and advantages of the disclosure, reference will now be made to the embodiments illustrated in the drawings and specific language will be used to describe the same.
In the related art, a one-to-one mapping relation between the characteristic value and the weight value of the pig can be established, and after the characteristic value of the pig is obtained, the weight of the pig is determined according to the mapping relation. However, the scheme has no fault tolerance mechanism, idealizes the data distribution, does not consider factors such as measurement errors, algorithm errors and the like, and in the linear regression fitting or nonlinear fitting process, the accuracy of prediction cannot be improved by simple one-to-one mapping.
Fig. 1 is a flow chart diagram of some embodiments of a method of estimating a target weight of the present disclosure.
In step 110, a feature value of the object to be assessed is extracted based on the body size information of the object. Wherein the plurality of eigenvalues form an eigenvalue set, the object is for example a pig. Those skilled in the art will appreciate that pigs are for example only and that other animals for which weight measurement is desired may be targeted.
In some embodiments, for a pig to be estimated, an image may be taken of the pig, body size information of the pig may be determined according to the image information, and a characteristic value of the pig may be determined according to the body size information. If a plurality of frames of images are captured, a plurality of feature values can be obtained. The body size information of the pig comprises body width information, shoulder width information, buttock width information, height information and the like.
In step 120, a maximum weight value and a minimum weight value corresponding to the feature value set are determined according to the correspondence between the feature value of the sample target and the weight range.
In some embodiments, the correspondence between the characteristic value of the sample target and the weight range may be saved in advance. As shown in fig. 2, even pigs of the same weight have characteristic values that are not single but are collected within a certain range, and the same pig has characteristic values that are different in a plurality of measurements. If only linear regression is used, the resulting linear regression line is as shown in FIG. 3, and does not express the trend of the data well, while single linear regression does not have good error compatibility. Thus, in this example, the correspondence between the characteristic value of the sample and the weight range was used to determine the weight of the pig.
In step 130, the number of eigenvalues in the eigenvalue set corresponding to each weight value between the maximum weight value and the minimum weight value is determined.
In some embodiments, after calculating the maximum weight value and the minimum weight value that are only possible for the pig, the number of the feature values in the feature value set corresponding to the minimum weight value may be determined first, then the weight values are adjusted at predetermined intervals sequentially until the maximum weight value, and the number of the feature values in the feature value set corresponding to each weight value is determined.
In step 140, an average value of the weight values corresponding to more than a predetermined number of characteristic values is used as the weight value of the target to be estimated.
The number threshold may be selected according to the actual situation. In some embodiments, an average of the weight values corresponding to the maximum number of feature values may be taken as the weight value of the target to be estimated.
In the above embodiment, the feature value of the target is extracted based on the body size information of the target to be estimated, and the maximum weight value and the minimum weight value corresponding to the feature value set of the target to be estimated are determined according to the weight range corresponding to the feature value of the sample target; determining the number of the characteristic values in the characteristic value set corresponding to each weight value between the maximum weight value and the minimum weight value; the average value of the weight values corresponding to the feature values exceeding the predetermined number is taken as the weight value of the target to be estimated, and the accuracy of target weight prediction can be improved because possible measurement errors and calculation errors are considered.
In other embodiments of the invention, the feeding strategy to the target to be assessed is adjusted based on the weight value of the target.
The weight can reflect the nutrition status, growth environment, growth stage and the like of pigs, and can provide important basis for producers in production management. In the pig raising process, the pigs are frequently weighed regularly, and the feeding amount, the pig house and the water intake are adjusted according to the change of the weight. In the embodiment, the weight of the pig can be accurately estimated, so that the feeding strategy of the pig is adjusted according to the weight of the pig, the growth of the pig can reach the optimal state, and the breeding efficiency is improved.
Fig. 4 is a flow chart of further embodiments of the method of estimating a target weight of the present disclosure.
In step 410, a reference correspondence relationship between the characteristic value and the weight value is determined based on the characteristic value and the weight value of the sample target, for example, a reference relationship function using the characteristic value as an independent variable and the weight value as a dependent variable is fitted. As shown in fig. 3, a linear fitting algorithm is used to fit a straight line f (x) =k·x+b of the correspondence between the characteristic value and the body weight value, where the x-axis represents the characteristic value, the f (x) axis represents the body weight value, and b is the intercept of the straight line and the coordinate axis.
Because of measurement errors and algorithm errors, the acquired features cannot be perfectly clustered in the region of the features, and the larger feature range can mislead the regressor estimation, so outliers need to be eliminated to improve the accuracy of the final estimation. Thus, prior to this step, discrete eigenvalues are removed.
In step 420, a reference weight value corresponding to the characteristic value of the sample target is determined according to the reference correspondence. For example, the weight value corresponding to the characteristic value 150 is 45kg.
In step 430, the range of the reference weight value is enlarged, and the correspondence between the characteristic value of the sample target and the weight range is obtained. For example, the weight range corresponding to the characteristic value 150 is widened to 40kg to 50kg.
In some embodiments, the reference correspondence is a reference correspondence function, and the intercept of the reference correspondence function is adjusted to obtain a first relationship function and a second relationship function, wherein the intercept of the first relationship function is larger than the intercept of the second relationship function, and each coordinate point in a correspondence region formed by coordinate lines and coordinate axes corresponding to the first relationship function and the second relationship function comprises a characteristic value attribute and a weight value attribute; and determining the corresponding relation between the characteristic value of the sample target and the weight range according to the coordinate points in the corresponding relation area. As shown in FIG. 5, for example, the slope of the fitted line is kept constant, and the intercept is adjusted to obtain two parallel lines, f 1 (x)=k·x+b 1 And f 2 =k·x+b 2 . Wherein b 1 >b 2 . As shown in fig. 6, the region formed by the two straight lines and the coordinate points of the coordinate axes is a correspondence region.
In some embodiments, the intercept of the first relationship function is greater than the intercept of the reference relationship function, and the intercept of the second relationship function is the same as the intercept of the reference relationship function. Alternatively, the intercept of the second relationship function is smaller than the intercept of the reference relationship function, and the intercept of the first relationship function is the same as the intercept of the reference relationship function. Alternatively, the intercept of the first relationship function is greater than the intercept of the reference relationship function and the intercept of the second relationship function is less than the intercept of the reference relationship function.
In some embodiments, the intercept of the reference relationship function is adjusted so that the ratio of the number of coordinate points formed by the characteristic values and the weight values of the sample targets to the number of coordinate points formed by the characteristic values and the weight values of all the sample targets in the corresponding relationship area is greater than a preset ratio. For example, so that more than 95% of the sample points can be covered between two straight lines.
In the above embodiment, the weight value corresponding to each characteristic value of the sample target is not one value, but one weight range, that is, the linear regression problem is innovatively expanded into the linear regression problem with range, and the fault tolerance of the regressor is expanded.
In some embodiments, the acquired features cannot be perfectly clustered in the region of the features due to measurement errors and algorithm errors, and a large range of features misleads the regressor estimation, thus requiring outliers to be eliminated to improve the accuracy of the final estimation. In this embodiment, outliers are detected using a median. For example, n eigenvalues H (i) are arranged in order from large to small, where { H (i) |h (i) ∈h, i=1, …, n }, H is a large set of eigenvalues. Finding feature values ordered at intermediate positionsWherein->Represent rounding down, — represent counting from back to front, i.e. h medium As a feature value center. Taking d=3 as the characteristic radius according to the characteristic distribution of the bright scene, so that a characteristic value set H excluding discrete points is obtained f ={h f ||h f -h medium D is smaller than or equal to d. By eliminating outliers, the calculation speed can be improved, and the embodiment does not need to cluster, but directly judges the outliers by a method of finding a median, so that the implementation is simple.
The present disclosure will be described below with reference to estimating pig weight.
Fig. 7 is a flow chart of further embodiments of the method of estimating a target weight of the present disclosure.
In step 710, a plurality of frames of image information containing pigs to be estimated are acquired.
In step 720, a plurality of body size information of the pigs to be estimated are determined according to each frame of image information. For example, each frame of image is input to a deep learning network, and the body size information of the pig is obtained through calculation of the deep learning network.
In step 730, a plurality of characteristic values of the pig to be estimated is determined according to the body size information. For example, the body width information, shoulder width information, hip width information, and body height information of the pig are weighted, and the result of the calculation is used as the characteristic value of the pig. How many frames of images are, how many feature values are obtained.
In step 740, a feature value center among a plurality of feature values of the pig to be evaluated is determined.
In step 750, a set of feature values having an absolute value of a difference from a feature value center of the plurality of feature values being equal to or smaller than a preset difference is used as the feature value set. The more the number of the reserved characteristic values is, the more accurate the estimated value is, but the real-time performance and the accuracy are measured at the same time.
Features of the same pig should be clustered in the middle of the two straight lines of the linear regression of the range prediction in fig. 6 and on the same horizontal line. Therefore, only the positions of the characteristic distribution are matched, and the weight of the pig can be obtained.
In step 760, determining a maximum weight value corresponding to the maximum feature value according to the first relationship function; and determining a minimum weight value corresponding to the minimum characteristic value according to the second relation function. If the characteristic value set of the pig is { x ] i e.X, i=1, …, m }, the maximum body weight value is f 1 (max (X)), minimum body weight value f 2 (min (X)). The weight range of the pig is f 2 (min(X))~f 1 (max(X))。
In step 770, the number of eigenvalues in the set of eigenvalues corresponding to each weight value between the maximum weight value and the minimum weight value is determined.
For example, at f 2 (min(X))~f 1 In the range of (max (X)), the number count (k) of feature points between two straight lines of linear regression in range prediction is satisfied while the fixed body weight is counted at intervals of 0.1 (adjustable according to the product accuracy requirement).
count(k)=c([argf 1 (w(k)),argf 2 (w(k))] ∩ [min(X),max(X)])
w(k)=0.1×k+f 2 (min(X))
f 2 (min(X))≤w(k)≤f 1 (max(X))
Where c (·) represents the number of elements in the statistics set, and k is a non-negative integer traversed from 0.
In step 780, the average value of the weight values corresponding to the maximum number of characteristic values is used as the weight value of the pig to be estimated. The average value of the weight corresponding to the count which meets the most conditions in the previous step is obtained and is used as the estimated weight of the pig:
w finiaI =ave(w(argcount(max(count)))
wherein ave (·) represents the average.
In the above embodiment, the linear regression range is extended, and the conventional one-to-one mapping is extended to the many-to-one mapping, so that the algorithm can allow the data to have more discrete distribution, the new range linear regression algorithm can allow factors such as measurement errors and the like to be added, and the weight value is matched by judging the approximate distribution range of the characteristic value, so that the accuracy of the weight estimation of pigs is improved. In addition, the outlier elimination algorithm based on the median in the embodiment can eliminate outliers rapidly, and improves the calculation efficiency.
Fig. 9 is a schematic structural view of some embodiments of the apparatus for estimating a target body weight of the present disclosure. The apparatus includes a feature value acquisition unit 910, a weight range determination unit 920, a feature value number determination unit 930, and a weight determination unit 940.
The feature value acquisition unit 910 is configured to extract a feature value of the target to be estimated based on the body scale information of the target to be estimated. Wherein the target is, for example, a pig, and the plurality of characteristic values form a characteristic value set.
In some embodiments, for a pig to be estimated, an image may be taken of the pig, body size information of the pig may be determined according to the image information, and a characteristic value of the pig may be determined according to the body size information. If a plurality of frames of images are captured, a plurality of feature values can be obtained. The body size information of the pig comprises body width information, shoulder width information, buttock width information, height information and the like.
The weight range determination unit 920 is configured to determine a maximum weight value and a minimum weight value corresponding to the feature value set according to the correspondence relationship between the feature value of the sample target and the weight range.
In some embodiments, the correspondence between the characteristic value of the sample target and the weight range may be saved in advance. As shown in fig. 2, even pigs of the same weight have characteristic values that are not single but are collected within a certain range, and the same pig has characteristic values that are different in a plurality of measurements. If only linear regression is used, the resulting linear regression line is as shown in FIG. 3, and does not express the trend of the data well, while single linear regression does not have good error compatibility. Thus, in this example, the correspondence between the characteristic value of the sample and the weight range was used to determine the weight of the pig.
The feature value number determination unit 930 is configured to determine the number of feature values in the feature value set corresponding to each weight value between the maximum weight value and the minimum weight value.
In some embodiments, after calculating the maximum weight value and the minimum weight value that are only possible for the pig, the number of the feature values in the feature value set corresponding to the minimum weight value may be determined first, then the weight values are adjusted at predetermined intervals sequentially until the maximum weight value, and the number of the feature values in the feature value set corresponding to each weight value is determined.
The weight determination unit 940 is configured to take an average value of weight values corresponding to more than a predetermined number of characteristic values as a weight value of the object to be estimated.
The number threshold may be selected according to the actual situation. In some embodiments, an average of the weight values corresponding to the maximum number of feature values may be taken as the weight value of the target to be estimated.
In the above embodiment, the feature value of the target to be estimated is extracted based on the body size information of the target, and the maximum weight value and the minimum weight value corresponding to the feature value set of the target to be estimated are determined according to the weight range corresponding to the feature value of the sample target; determining the number of the characteristic values in the characteristic value set corresponding to each weight value between the maximum weight value and the minimum weight value; the average value of the weight values corresponding to the feature values exceeding the predetermined number is taken as the weight value of the target to be estimated, and the accuracy of the target weight measurement can be improved because possible measurement errors and calculation errors are considered.
In other embodiments, the feature value acquisition unit 910 is further configured to determine a feature value center of the plurality of feature values; and taking a set of characteristic values, of which the absolute value of the difference from the characteristic value center is smaller than or equal to a preset difference value, as a characteristic value set. Because of measurement errors and algorithm errors, the acquired features cannot be perfectly clustered in the region of the features, and the larger feature range can mislead the regressor estimation, so outliers need to be eliminated to improve the accuracy of the final estimation.
In other embodiments, the apparatus may further comprise a feeding strategy adjustment unit configured to adjust a feeding strategy for a target to be assessed based on a weight value of the target. In the embodiment, the weight of the pig can be accurately estimated, and the weight can reflect the nutrition status, the growth environment, the growth stage and the like of the pig, so that the feeding strategy of the pig is adjusted according to the weight of the pig, the growth of the pig can reach the optimal state, and the breeding efficiency is improved.
Fig. 10 is a schematic structural view of other embodiments of the apparatus for estimating a target body weight of the present disclosure. The apparatus further includes a reference relationship determination unit 1010, a reference weight value determination unit 1020, and a correspondence determination unit 1030.
The reference relation determining unit 1010 is configured to determine a reference correspondence relation of the characteristic value and the weight value from the characteristic value and the weight value of the sample target, for example, fit a reference relation function having the characteristic value as an independent variable and the weight value as a dependent variable.
For example, as shown in fig. 3, a linear fitting algorithm is used to fit a straight line f (x) =k·x+b of the correspondence between the characteristic value and the body weight value, where the x-axis represents the characteristic value, the f (x) axis represents the body weight value, and b is the intercept of the straight line and the coordinate axis.
The reference weight value determination unit 1020 is configured to determine a reference weight value corresponding to the characteristic value of the sample target according to the reference correspondence.
The correspondence determination unit 1030 is configured to expand the range of the reference weight value, resulting in a weight range corresponding to the characteristic value of the sample target.
In some embodiments, the reference correspondence is a reference correspondence function, and the correspondence determining unit 1030 adjusts an intercept of the reference correspondence function to obtain a first relationship function and a second relationship function, where the intercept of the first relationship function is greater than that of the second relationship function, and each coordinate point in a correspondence region formed by coordinate lines and coordinate axes corresponding to the first relationship function and the second relationship function includes a characteristic value attribute and a weight value attribute; and determining the corresponding relation between the characteristic value of the sample target and the weight range according to the coordinate points in the corresponding relation area. As shown in FIG. 5, for example, the slope of the fitted line is kept constant, and the intercept is adjusted to obtain two parallel lines, f 1 (x)=k·x+b 1 And f 2 =k·x+b 2 . Wherein b 1 >b 2 . As shown in fig. 6, the region formed by the two straight lines and the coordinate points of the coordinate axes is a correspondence region.
In the above embodiment, the weight value corresponding to each characteristic value of the sample target is not one value, but one weight range, that is, the linear regression problem is innovatively expanded into the linear regression problem with range, and the fault tolerance of the regressor is expanded.
Fig. 11 is a schematic structural view of other embodiments of the apparatus for estimating a target body weight of the present disclosure. The apparatus includes a memory 1110 and a processor 1120, wherein: memory 1110 may be a magnetic disk, flash memory, or any other non-volatile storage medium. The memory is used to store instructions in the embodiments corresponding to figures 1, 4 and 7. Processor 1120, coupled to memory 1110, may be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 1120 is configured to execute instructions stored in the memory.
In some embodiments, as also shown in FIG. 12, the apparatus 1200 includes a memory 1210 and a processor 1220. Processor 1220 is coupled to memory 1210 by BUS 1230. The device 1200 may also be connected to an external storage device 950 via a storage interface 1240 to invoke external data, and may also be connected to a network or another computer system (not shown) via a network interface 1260, not described in detail herein.
In this embodiment, the data command is stored in the memory, and the processor processes the command, so that the accuracy of target weight estimation can be improved, and a basis is provided for feeding strategy adjustment.
In other embodiments, a computer readable storage medium has stored thereon computer program instructions which, when executed by a processor, implement the steps of the methods of the corresponding embodiments of fig. 1, 4, 7. It will be apparent to those skilled in the art that embodiments of the present disclosure may be provided as a method, apparatus, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions 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.
Thus far, the present disclosure has been described in detail. In order to avoid obscuring the concepts of the present disclosure, some details known in the art are not described. How to implement the solutions disclosed herein will be fully apparent to those skilled in the art from the above description.
Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It will be appreciated by those skilled in the art that modifications may be made to the above embodiments without departing from the scope and spirit of the disclosure. The scope of the present disclosure is defined by the appended claims.