Method and sensor arrangement for determining a milk-flow rate, computer program and non-volatile data carrier
The sensor arrangement with electrode pairs and ANN accurately measures milk flow rate, overcoming irregular air-milk ratios to ensure reliable milk yield calculations.
Patent Information
- Application Number
- PCT/SE2025/050588
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-28
- Filing Date
- 2025-06-19
- Publication Date
- 2026-01-02
AI Technical Summary
Existing methods for measuring milk flow rate during milking sessions face challenges due to the irregular variation in the ratio of milk and air, leading to inaccurate milk yield calculations.
A sensor arrangement using a measurement chamber with reference and measurement electrode pairs, combined with a trained artificial neural network (ANN), to determine milk flow rate by analyzing conductivity and impedance values, enabling accurate milk flow rate estimation despite fluctuating air-milk ratios.
The solution provides reliable and accurate milk flow rate measurements, ensuring precise calculation of milk yield by integrating the flow rate over time.
Smart Images

Figure SE2025050588_02012026_PF_FP_ABST
Abstract
Description
[0001] Method and Sensor Arrangement for Determining a Milk- Flow Rate, Computer Program and Non-Volatile Data Carrier
[0002] TECHNICAL FIELD
[0003] The present invention relates generally to milk measurements. Especially, the invention relates to a method for determining a milk-flow rate of a fluid comprising milk or a mixture of milk and gas that passes through a measurement chamber during a milking session for an animal according to the preamble of claim 1 and a sensor arrangement that implements the method. The invention also relates to a computer program for executing the method when the program is run on a processing unit, and a non-volatile data carrier storing such a computer program.
[0004] BACKGROUND
[0005] Typically, the process of automatically extracting milk from a dairy animal involves transporting a mixture of milk and air from at least one teatcup through a conduit. The specific ratio of milk and air in the mixture varies in a highly irregular manner during a milking session. It is therefore challenging to measure the milk flow rate in the conduit with adequate accuracy. Further, since an overall milk yield during the milking session is normally calculated by integrating the milk-flow-rate values over time, the milk yield value also becomes unreliable. The prior art includes various examples of solutions that tackle this problem.
[0006] US 10,598,528 reveals an apparatus includes a tube, first and second pairs of electrodes, a reference device, and a processor. The processor determines a speed of a fluid traveling between the first and second pairs of electrodes and determines a reference conductance of the fluid using the reference device. The processor also determines a measured conductance of the fluid using at least one of the first and second pairs of electrodes and determines, based on the reference conductance and the measured conductance, a cross-sectional area of the fluid at an electrode. The processor further adds a correction factor to the determined speed to produce a bulk speed of the fluid. The processor further determines a volumetric flow rate of the fluid based on the bulk speed and the determined area and determines a volume of the fluid based on the determined volumetric flow rate.
[0007] US 9,470,565 describes device for determining a mass flow rate of a fluid in a conduit, for instance a milk flow through a tube. The device includes a measuring member for determining an electrical conductivity of the fluid; an additional measuring member for determining the electrical conductivity of the fluid at an additional position; and a processing unit for determining the mass flow rate of the fluid in the conduit on the basis of the determinations, wherein the specific resistance can be determined per cross-sectional area in the flow.
[0008] CN 107006377 B discloses a cow milking capacity detection device and a method based on a neural network. The device includes a square pipe, a constant current source module, an infrared light emitting module, a triode switch module, a temperature sensor, a single chip microcomputer, a signal filtering and amplification module, a wireless communication module, a radio frequency card module, an infrared receiving module and a host computer system. The infrared light emitting module, the triode switch module and the temperature sensor are located on the top of the square pipe. The single chip microcomputer, the signal filtering and amplification module, the wireless communication module, the radio frequency card module and the infrared receiving module is located on the bottom of the square pipe. In the design of the system, near infrared light is used for non-contact measurement, the neural network algorithm is added in the designed system, so that the detection is more accurate and faster, and the problem that nonlinear variation of unknown interference factors affect the calculation result in the cow milking capacity calculation process is solved. By means of the device and the method, liquid, solid, semiconductor, colloid and other samples can be directly measured. Thus, technical solutions exist for measuring the milk-flow rate in a conduit that contains a mixture of milk and air, where the relationship between milk and air varies over time. However, since it is very complicated to define a correct deterministic model of such a flow, the known solutions provide unsatisfactory accuracy. The prior art also includes one example of a neural network-based detection device for cow milking volume, which relies on infrared light measurements. Although this approach may avoid the difficulties with the deterministic model, other problems arise here, for example relating to conducting light through the mixture.
[0009] SUMMARY
[0010] The object of the present invention is to offer a solution that overcomes the above problems and provides reliable measures of a milk flow rate during a milking session for an animal.
[0011] According to one aspect of the invention, the object is achieved by a sensor arrangement for determining a milk-flow rate of a fluid comprising milk or a mixture of milk and gas through a conduit during a milking session for an animal, which milk-flow rate represents an estimated amount of milk per unit time that passes through the conduit. The sensor arrangement includes a sensor device, a measurement unit, a processing device and a trained artificial neural network (ANN). The sensor device is arranged on the conduit such that the fluid passes through the sensor device via the conduit. The sensor device comprises a measurement chamber configured to measure the milk-flow rate. A reference electrode pair is arranged in the measurement chamber. First and second measurement electrode pairs are also arranged therein in series with one another. Each of the first and second measurement electrode pairs contains a respective first and second electrode, which each is arranged in the measurement chamber such that the electrode surrounds a cross section of the measurement chamber. The reference electrode pair includes first and second reference electrodes, which each is arranged in the measurement chamber to make electrical contact with the milk of the fluid in the measurement chamber, where each of the first and second reference electrodes respectively is arranged. The measurement unit is configured to produce a stream of data reflecting at least one electrical characteristic of the fluid that passes through the measurement chamber. The stream of data is produced by supplying probing signals to the first and second measurement electrode pairs and the reference electrode pair, obtaining from each of the first and second measurement electrode pairs and the reference electrode pair a respective resulting signal and based thereon determine the at least one electrical characteristic. The processing device is configured to obtain the stream of data and based thereon derive a conductivity and / or an impedance value of the fluid that passes through the measurement chamber at each of the first and second measurement electrode pairs respectively. The processing device is also configured to derive, repeatedly, based on the conductivity and / or impedance values, a milk-filling factor in the measurement chamber and a speed of the fluid that passes through the measurement chamber. Here, the deriving of the milk-filling factor involves comparing, repeatedly, the conductivity and / or the impedance value of the fluid at the first measurement electrode pair with the conductivity and / or the impedance value of the milk of the fluid at the reference electrode pair to obtain a value of a first test parameter. Analogously, the conductivity and / or the impedance value of the fluid at the second measurement electrode pair is repeatedly compared with the conductivity and / or the impedance value of the milk of the fluid at the reference electrode pair to obtain a value of a second test parameter. The deriving of the speed involves mapping a first series of values against a second series of values in a set of temporal windows, for example by cross correlating the series of values to one another, which first series of values contains the values of the first test parameter in the set of temporal windows, and which second series of values contains the values of the second test parameter in the set of temporal windows. The trained ANN is configured to repeatedly determine the milk-flow rate based on the milk-filling factor in the measurement chamber and the speed of the fluid that passes through the measurement chamber.
[0012] This sensor arrangement is advantageous because it is capable of providing accurate milk-flow rate data regardless of how the ratio between milk and gas fluctuates during the milking session. Consequently, a milk-yield value derived from the milk-flow rate through integration over time data also becomes reliable.
[0013] According to one embodiment of this aspect of the invention, each of the first and second reference electrodes is arranged in the measurement chamber to make electrical contact with the milk of the fluid in the measurement chamber at a respective lowest point of a cross-section of the measurement chamber where each of the first and second reference electrodes respectively is arranged. Namely, thereby it is ensured that, if at all there is milk in the measurement chamber, the reference electrodes will be able to feed an electrical current there through, and thus obtain a reference value of the at least one electrical characteristic of the milk, such as its conductivity.
[0014] According to another embodiment of this aspect of the invention, the trained ANN is a fully connected multilayer neural network that includes one input layer, one output layer and at least four hidden layers interconnecting the input and output layers. For example, the input layer may contain two nodes adapted to receive values of the milk-filling factor and the speed of the fluid respectively, and the output layer may contain one node adapted to directly, or indirectly, provide a value of the milk-flow rate. Preferably, the trained ANN is a multilayer perceptron including up to six hidden layers. Namely, this has proven to deliver high-quality data. Further, it may be advantageous if the input layer contains more than two nodes, such that parameters in addition to said milk-filling factor and speed may be received. For example, such additional parameters may relate to various calibration aspects.
[0015] According to yet other embodiments of this aspect of the invention, the trained ANN is implemented by means of a computer program run on at least one processing unit, or the trained ANN is implemented on at least one neuromorphic circuit, i.e. a hardware mixed-signal integrated circuit that contains both analog circuits and digital circuits, which aims at mimicking biological neural functions.
[0016] According to still another embodiment of this aspect of the invention, the measurement unit, the processing device and the trained ANN are all comprised in a common physical unit that constitutes the sensor arrangement. This namely allows for a convenient and compact implementation.
[0017] According to a further embodiment of this aspect of the invention, the trained ANN has been trained through a process wherein, during at least one milking session for an animal, the following actions have been performed. Milk has been extracted from the animal by using a milking equipment, a fluid comprising the extracted milk or a mixture of the extracted milk and gas has been fed from the milking equipment through the sensor device via a conduit into a vessel and a scale has repeatedly registered a weight of the vessel. From the scale, a training unit has repeatedly obtained updates of increments of the weight of the vessel, where the increments result from amounts of the extracted milk entering the vessel. In parallel, the measurement unit has supplied probing signals to the first and second measurement electrode pairs and the reference electrode pair, obtained from each of the first and second measurement electrode pairs and the reference electrode pair a respective resulting signal, and based thereon determined the at least one electrical characteristic. Further, the processing device has obtained the stream of data, and based thereon repeatedly derived the conductivity and / or the impedance value of the fluid that passes through the measurement chamber at each of the first and second measurement electrode pairs respectively and the conductivity and / or the impedance value of the extracted milk of the fluid that passes the reference electrode pair, and further based thereon the processing device has repeatedly derived an update of the milkfilling factor at each of the first and second measurement electrode pairs and the processing device has repeatedly derived an update of the speed of the fluid that passes through the measurement chamber. In addition, the training unit has repeatedly obtained the updates of the milk-filling factor and the speed. Based thereon, and in conjunction with said updates of the weight increments, an ANN under training has been trained until a convergence criterion is fulfilled.
[0018] According to another embodiment of this aspect of the invention, the sensor arrangement includes a time reference source configured to provide a common time reference to each of the scale and the processing unit respectively. Further, the scale is configured to produce the updates of the increments of the weight of the vessel in synchronization with the common time reference and the processing unit is configured to produce the updates of the milk-filling factor and the speed in synchronization with the common time reference. Consequently, the training unit may train the ANN under training in a synchronized manner based on the common time reference. Although there may be an unknown delay between the point in time when the electrical characteristics underlaying the milk-filling factor and the speed are registered and a corresponding weight increment occurs, this delay is systematic. Hence, the trained ANN will nevertheless be capable of producing reliable milk-flow rate values.
[0019] According to one embodiment of this aspect of the invention, the ANN under training has weights, which are determined iteratively via a backpropagation training process that involves comparing the incremental weight updates of the vessel with outputs from the ANN under training, which outputs express updated estimates of the incremental weight updates of the vessel produced by the ANN under training, where the latter, in turn, are based on training data expressing the updates of the milk-filling factor and the speed respectively.
[0020] Preferably, the backpropagation training process contains 80 to 120 epochs, and more preferably around 100 epochs. Moreover, to add an amount of random noise and thus assist convergence of the training process, the ANN under training may include a Gaussian- noise layer after the input layer.
[0021] According to another aspect of the invention, the object is achieved by a method for determining a milk-flow rate of a fluid comprising milk or a mixture of milk and gas through a measurement chamber during a milking session for an animal. The milkflow rate represents an estimated amount of milk per unit time that passes through the measurement chamber, which is presumed to contain a reference electrode pair and first and second measurement electrode pairs arranged in series with one another. Specifically, each of the first and second measurement electrode pairs is presumed to contain a respective first and second electrode, which each is arranged in the measurement chamber such that each of the first and second electrode surrounds a cross section of the measurement chamber. Moreover, the reference electrode pair contains first and second reference electrodes, which each is arranged in the measurement chamber to make electrical contact with the milk of the fluid in the measurement chamber. The method involves obtaining, from a measurement unit, a stream of data reflecting at least one electrical characteristic of the fluid that passes through the measurement chamber. The measurement unit is presumed to be configured to supply probing signals to the first and second measurement electrode pairs and the reference electrode pair, obtain from each of the first and second measurement electrode pairs and the reference electrode pair a respective resulting signal and based thereon determine the at least one electrical characteristic. The method further involves deriving, based on the stream of data and using a processing device, a conductivity and / or an impedance value of the fluid that passes through the measurement chamber at each of the first and second measurement electrode pairs respectively. Additionally, the method involves deriving, based on the conductivity and / or the impedance values and using the processing device, a milk-filling factor in measurement chamber and a speed of the fluid that pas- ses through the measurement chamber. The deriving of the milkfilling factor involves comparing, repeatedly, the conductivity and / or the impedance value of the fluid at the first measurement electrode pair with the conductivity and / or the impedance value of the milk of the fluid at the reference electrode pair to obtain a value of a first test parameter; and comparing, repeatedly, the conductivity and / or the impedance value of the fluid at the second measurement electrode pair with the conductivity and / or the impedance value of the milk of the fluid at the reference electrode pair to obtain a value of a second test parameter. The deriving of the speed involves mapping a first series of values against a second series of values in a set of temporal windows, which first series of values contains the values of the first test parameter in the set of temporal windows, and which second series of values contains the values of the second test parameter in the set of temporal windows. The method also involves determining, repeatedly, by means of a trained ANN, the milk-flow rate. The trained ANN is here configured to determine the milk-flow rate based on the milkfilling factor in the measurement chamber and the speed of the fluid that passes through the measurement chamber. The advantages of this method are apparent from the discussion above with reference to the proposed sensor arrangement.
[0022] Preferably, the speed of the fluid is derived by a process that involves determining a temporal difference between the first and second series of values based on said mapping, which temporal difference expresses an estimated delay for the fluid to pass between the first and second measurement electrode pairs. Said speed is then calculated as a distance between the first and second measurement electrode pairs divided by the estimated delay.
[0023] According to one embodiment of this aspect of the invention, the milk-filling factor is a number between 0 and 1 , where 0 designates that no milk is present at the position in the measurement chamber where the first or second measurement electrode pair respectively is located and 1 designates that the measurement chamber is completely filled with milk at the position where the measurement electrode pair is located. A number between 0 and 1 designates that the fluid comprises the mixture of milk and gas at the position where the measurement electrode pair is located. Thus, any milk- to-gas ratios may be expressed in an unambiguous and straightforward manner.
[0024] According to another embodiment of this aspect of the invention, the above first test parameter is obtained as a ratio between the conductivity and / or the impedance value of the fluid at the first measurement electrode pair and the conductivity and / or the impedance value of the milk of the fluid at the reference electrode pair. Analogously, the above second test parameter is obtained as a ratio between the conductivity and / or an impedance value of the fluid at the second measurement electrode pair and the conductivity and / or the impedance value of the milk of the fluid at the reference electrode pair. Such comparison of the electrical characteristics at the first or second measurement electrode pairs and the reference electrode pair enables a dynamic calibration with respect to the specific properties of the milk that is currently transported through the measurement chamber.
[0025] According to yet another embodiment of this aspect of the invention, each temporal window in the above-mentioned set of temporal windows has an extension in time in a range from one to ten seconds, preferably around five seconds. Namely, this has proven to strike a good balance between the computational load on the processing device and the updating frequency of the output milk-flow rate value.
[0026] According to embodiments of this aspect of the invention, each temporal window in the set of temporal windows preferably has a stride with respect to a previous temporal window in the set of temporal windows, which stride is in a range from 10 to 50 %, more preferably around 20 %, of the extension in time of each temporal window in the set of temporal windows; and each temporal window in the set of temporal windows has an overlap with respect to a previous temporal window in the set of temporal windows, which overlap is in a range from 50 to 80 %, preferably around 60 %, of the extension in time of each temporal window in the set of temporal windows.
[0027] According to still another embodiment of this aspect of the invention, the method comprises determining, repeatedly, an updated value of the milk-flow rate, wherein the updated value of the milkflow rate is determined at a frequency being inversely proportional to an extension in time of the stride. Namely, this is the maximum frequency at which the milk-flow rate may be updated.
[0028] According to one embodiment of this aspect of the invention, the values in the first second series that represent each of the first and second test parameters respectively are quantified in a number of discrete levels, which number is in a range from 4 to 64, and preferably in a range from 8 to 16. Thereby, this provides an appropriate resolution to determine an accurate milk-flow rate.
[0029] According to another embodiment of this aspect of the invention, before mapping the first series of values against the second series of values, the method involves normalizing each of the first and second series of values, for example in the form of min-max scaling or Z-score normalization (also known as mean-max scaling). As a result, the method becomes less sensitive any peaks or high values in the input data originating from the measurements chamber.
[0030] According to a further embodiment of this aspect of the invention, a total milk yield extracted during the milking session is also derived based on the milk-flow rate and a duration of the milking session in question. The total milk yield is typically the single most relevant parameter to the farmer and is thus a valuable output.
[0031] According to a further aspect of the invention, the object is achieved by a computer program loadable into a non-volatile data carrier communicatively connected to at least one processing unit. The computer program includes software for executing the above method when the program is run on the at least processing unit. According to another aspect of the invention, the object is achieved by a non-volatile data carrier containing the above computer program.
[0032] Further advantages, beneficial features and applications of the present invention will be apparent from the following description and the dependent claims.
[0033] BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The invention is now to be explained more closely by means of preferred embodiments, which are disclosed as examples, and with reference to the attached drawings.
[0035] Figure 1 schematically illustrates a sensor arrangement according to one embodiment of the invention;
[0036] Figure 2 illustrates how an ANN may be trained according to one embodiment of the invention;
[0037] Figure 3 illustrates the general principle according to which the ANN may be trained according to one embodiment of the invention;
[0038] Figure 4 shows a functional block diagram of the trained ANN according to one embodiment of the invention;
[0039] Figures 5a-b illustrate examples of histograms according to one embodiment of the invention, which histograms describe first and second series of test parameters respectively; and
[0040] Figure 6 illustrates, by means of a flow diagram, the general method for determining milk-flow rate values according to the invention.
[0041] DETAILED DESCRIPTION
[0042] Figure 1 shows a schematic illustration of a sensor arrangement 190 according to one embodiment of the invention. The sensor arrangement 190 is adapted to determine a milk-flow rate Q of a fluid that comprises milk or a mixture of milk and gas through a conduit 165 during a milking session for an animal. The milk-flow rate Q represents an estimated amount of milk per unit time that passes through the conduit 165.
[0043] During the milking session of the animal milk is extracted by using a milking equipment that works in a conventional manner. The milking equipment comprises teat cups and each teat cup comprises a shell and a liner. During the milking session a teat cup is attached to a respective teat of the animal and an under pressure prevails under the teat. The space between the liner and the shell is alternatively connected to atmospheric pressure and under pressure with a certain frequency and hereby the liner opens and closes. Said certain frequency is approximately 1 Hz if the animals are cows. When the liner is opened milk is extracted from the teat and when the liner is closed the teat end is massaged by the liner. The extracted milk is transported to a sensor device (140) of the sensor arrangement (190) according to the invention with the aid of gas and the under pressure prevailing under the teat. The gas is usually atmospheric air.
[0044] The sensor arrangement 190 includes a sensor device 140, a measurement unit 130, a processing device 150 and a trained ANN 180.
[0045] According to one embodiment of the invention, the measurement unit 130, the processing device 150 and the trained ANN 180 are all comprised in a common physical unit that constitutes the sensor arrangement 190. Technically, one or more of said components may, of course, equally well be located outside of the sensor arrangement 190, however in communicative connection with the components therein.
[0046] The sensor device 140 is arranged on the conduit 165, such that the fluid passes through the sensor device 140 via the conduit 165. The sensor device 140 contains a measurement chamber 160 configured to measure the milk-flow rate Q. A reference electrode pair 170 is arranged in the measurement chamber 160 together with first and second measurement electrode pairs 110 and 120 respectively. The first and second measurement electrode pairs 110 and 120 are arranged in series with one another. Each of the first and second measurement electrode pairs 110 and 120 contains a respective first and second electrode 111 , 112 and 121 , 122 respectively, which each is arranged in the measurement chamber 160 such that the electrode surrounds a cross section of the measurement chamber 160. The reference electrode pair 170 comprises first and second reference electrodes 171 and 172 respectively, which each is arranged in the measurement chamber 160 to make electrical contact with the milk of the fluid in the measurement chamber 160 where each of the first and second reference electrodes respectively is arranged. Preferably, a distance d1 between the first and second electrode 111 , 112 and 121 , 122 respectively is the same in each of the first and second measurement electrode pairs 110 and 120. The distance between the first and second reference electrodes 171 and 172 may or may not be equal to d1. Further, according to embodiments of the invention, the reference electrode pair 170 may be arranged between the first and second measurement electrode pairs 110 and 120, as shown in Figure 1 , or on either side, upstream or downstream, of both of them. Preferably, however not necessarily, a distance d2 between the first and second measurement electrode pairs 110 and 120 respectively is larger than the distance d1 .
[0047] According to one embodiment of the invention, each of the first and second reference electrodes 171 and 172 respectively is arranged in the measurement chamber 160 to make electrical contact with the milk of the fluid in the measurement chamber 160 at a respective lowest point of a cross-section of the measurement chamber 160, where each of the first and second reference electrodes respectively is arranged. This namely ensures that, if there is at all any milk in the measurement chamber 160, the first and second reference electrodes 171 and 172 will be capable to pass an electrical current there through, and thus obtain a reference value of the at least one electrical characteristic of the milk, such as its conductivity o and / or impedance Z.
[0048] The measurement unit 130 is configured to produce a stream of data RD that reflects at least one electrical characteristic of the fluid that passes through the measurement chamber 160. For example, the stream of data RD may reflect current and / or voltage values measured via the first and second measurement electrode pairs 1 10 and 120 and the reference electrode pair 170. Alternatively, and or in addition, the stream of data RD may reflect conductivity o and / or impedance Z value derived based on electrical measurements made via the first and second measurement electrode pairs 1 10 and 120 and the reference electrode pair 170.
[0049] The stream of data RD may either be transferred as a single series of values, or in the form of two or more parallel series of values.
[0050] The stream of data RD is produced by supplying probing signals to the first and second measurement electrode pairs 1 10 and 120 respectively and the reference electrode pair 170, obtaining from each of the first and second measurement electrode pairs 1 10 and 120 and the reference electrode pair 170 a respective resulting signal and based thereon determine the at least one electrical characteristic.
[0051] The processing device 150 is configured to obtain the stream of data RD and based thereon derive a conductivity o value and / or an impedance Z value of the fluid that passes through the measurement chamber 160 at each of the first and second measurement electrode pairs 1 10 and 120 respectively. Depending on the type of electrical characteristics that the stream of data RD represents, deriving the conductivity o and / or impedance Z values may either be trivial, i.e. if the stream of data RD itself already reflects such conductivity o and / or impedance Z values, or involve calculations, i.e. if the stream of data RD reflects other types of electrical characteristics of said fluid. Based on said conductivity o and / or impedance Z values, the processing device 150 is further configured to repeatedly derive a milk-filling factor FF in measurement chamber 160 and a speed v of the fluid that passes through the measurement chamber 160.
[0052] The deriving of the milk-filling factor FF involves comparing, repeatedly, the conductivity o and / or the impedance Z value of the fluid at the first measurement electrode pair 110 with the conductivity o and / or the impedance Z value of the milk of the fluid at the reference electrode pair 170 to obtain a value of a first test parameter T 1 . According to one embodiment of the invention, the first test parameter T1 is obtained as a ratio between the conductivity o and / or the impedance Z value of the fluid at the first measurement electrode pair 110 and the conductivity o and / or the impedance Z value of the milk of the fluid at the reference electrode pair 170.
[0053] The deriving of the milk-filling factor FF also involves comparing, repeatedly, the conductivity o and / or the impedance Z value of the fluid at the second measurement electrode pair 120 with the conductivity o and / or the impedance Z value of the milk of the fluid at the reference electrode pair 170 to obtain a value of a second test parameter T2. According to one embodiment of the invention, the second test parameter T2 is obtained as a ratio between the conductivity o and / or the impedance Z value of the fluid at the second measurement electrode pair 120 and the conductivity o and / or the impedance Z value of the milk of the fluid at the reference electrode pair 170.
[0054] Figures 5a and 5b show histograms that describe examples of first and second series of values 510 and 520 respectively of the first and second test parameters T1 and T2 respectively.
[0055] According to one embodiment of the invention, the milk-filling factor FF is a number between 0 and 1. Here, 0 designates that no milk is present at the position in the measurement chamber 160 where the first or second measurement electrode pair 110 or 120 respectively is located, and 1 designates that the measurement chamber 160 is completely filled with milk at the position where the measurement electrode pair 110 or 120 respectively is located. A number between 0 and 1 designates that the fluid comprises the mixture of milk and gas at the position where the measurement electrode pair 110 or 120 respectively is located.
[0056] The deriving of the speed v of said fluid involves mapping the first series of values 510 against the second series of values 520 in a set of temporal windows 501 , 502, ... , 50n, for example by cross correlating the first series of values 510 with the second series of values 520. An alternative mapping may be obtained by calculating a root-mean-square deviations between the first and second series of values 510 and 520 respectively. The first series of values 510 here contains the values of the first test parameter T1 in the set of temporal windows 501 , 502, ... , 50n and the second series of values 520 contains the values of the second test parameter T2 in the set of temporal windows 501 , 502, ... , 50n.
[0057] According to one embodiment of the invention, each temporal window in the set of temporal windows 501 , 502, ... , 50n has an extension E in time t in a range from one to ten seconds. Preferably, each temporal window has an extension E around five seconds.
[0058] Further preferably, each temporal window 502 in the set of temporal windows 501 , 502, ... , 50n has a stride ST, i.e. a time shift, with respect to a previous temporal window in a range from 10 % to 50 % of the extension E in time t of each temporal window. For example, a temporal window 502 may be time shifted by 10 % relative an immediately preceding temporal window 501 , such that there is an 80 % overlap between the values in the temporal windows 501 and 502. Preferably, the stride ST is around 20 % of the extension E in time t of each temporal window in the set of temporal windows 501 , 502, ... , 50n. Hence, if each window has an extension E of five seconds, the stride ST is preferably one second.
[0059] Preferably, the processing device 150 is configured to determine an updated value of the milk-flow rate Q repeatedly. Specifically, according to one embodiment of the invention, the method involves determining the updated value of the milk-flow rate Q at a frequency that is inversely proportional to an extension in time t of the stride ST. In other words, the shorter the stride ST, the higher the updating frequency of the milk-flow rate value Q.
[0060] As an alternative to the stride ST, the temporal relationship between consecutive temporal windows may be expressed in terms of overlap. According to one embodiment of the invention, each temporal window, say 502, in the set of temporal windows 501 , 502, ... , 50n has an overlap OP with respect to a previous temporal window, here 501 , which overlap OP is in a range from 50 % to 80 % of the extension E in time t of each temporal window in the set of temporal windows 501 , 502, ... , 50n. Preferably, the overlap OP is around 60 % of the extension E in time t of each temporal window.
[0061] According to one embodiment of the invention, the values in the first second series 510 and 520 that represent each of the first and second test parameters T1 and T2 respectively are quantified in a number of discrete levels. Figures 5a and 5b illustrate eight such levels L0, L1 , L2, L3, L4, L5, L6 and L7 respectively. Technically, the values in the first second series 510 and 520 may be quantified in any number of levels. However, preferably, to place a reasonable computational load on the processing device 150, the number of discrete levels is in a range from 4 to 64, and preferably in a range from 8 to 16.
[0062] According to one embodiment of the invention, the speed v of the fluid is derived by a process that involves determining a temporal difference At between the first and second series of values 510 and 520 respectively based on the above-mentioned mapping, e.g. effected through a cross correlation operation. The temporal difference At expresses an estimated delay for the fluid to pass between the first and second measurement electrode pairs 110 and 120. The mapping identifies when a first pattern of the values of the first test parameter T 1 matches a second pattern of the va- lues of the second test parameter T2. In other words, if the mapping shows a value above a threshold level, a particular ratio of milk and gas in the mixture of the fluid has been detected at both the first and second measurement electrode pairs 110 and 120, however at different points in time. The processing device 150 is here configured to calculate the speed v of said fluid as the distance d2 between the first and second measurement electrode pairs 110 and 120 respectively divided by the estimated delay, which is expressed by the temporal difference At.
[0063] According to one embodiment of the invention, before mapping the first series of values 510 against the second series of values 520, the method involves normalizing each of the first and second series of values 510 and 520 respectively. For instance, the values in said series may be normalized according to a min-max scaling or Z-score normalization (also known as mean-max scaling) process. Namely, this renders the method less sensitive to any peaks or high values in the input data originating from the measurement chamber 160.
[0064] The trained ANN 180 is configured to repeatedly determine the milk-flow rate Q based on the milk-filling factor FF in the measurement chamber 160, and the speed of v said fluid that passes through the measurement chamber 160.
[0065] According to one embodiment of the invention, the processing device 150 is further configured to derive a total milk yield Y extracted during the milking session. To this end, the processing device 150 is configured to obtain the milk-flow rate Q from the trained ANN 180 and a piece of information that indicates a duration of the milking session for the animal. The processing device 150 is then configured to integrate the values of the milk-flow rate Q over the time period of the milking session to derive the total milk yield Y extracted during the milking session.
[0066] Figure 2 illustrates a setup for training the ANN 180 according to one embodiment of the invention, Figure 3 illustrates the general principle for training the ANN 180 in a training unit 200 according to one embodiment of the invention and Figure 4 shows a functional block diagram of the trained ANN 180 according to one embodiment of the invention.
[0067] In the setup of Figure 2, an initially untrained ANN 180’ is placed in the training unit 200. The untrained ANN 180’ undergoes a training process wherein, during at least one milking session for an animal, the following events occur.
[0068] Milk is extracted from the animal by using a milking equipment, here schematically represented by a generic teat cup cluster 210. A fluid comprising the extracted milk or a mixture of the extracted milk and gas is fed from the milking equipment 210 through the sensor device 140 via a conduit 165 into a vessel 260. The vessel 260 rests on a scale 265 that repeatedly registers a weight of the vessel 260.
[0069] The training unit 200 repeatedly obtains updates of the increments AW(t) of the weight of the vessel 260 from the scale 265. The increments AW(t) of the weight result from amounts of the extracted milk entering the vessel 260 via the conduit 165, which amounts are equivalent to respective volume units of milk.
[0070] The sensor device 140 contains the above-described the measurement unit 130 and measurement chamber 160. The measurement unit 130 supplies probing signals to the first and second measurement electrode pairs 1 10 and 120 respectively and the reference electrode pair 170 in the measurement chamber 160, obtains from each of the first and second measurement electrode pairs 1 10 and 120 respectively and the reference electrode pair 170 a respective resulting signal, based thereon determines, repeatedly, the at least one electrical characteristic of the fluid that passes through the measurement chamber 160, and produces a stream of data RD that contains a series of values of the at least one electrical characteristic.
[0071] The processing device 150 obtains the stream of data RD, and based thereon repeatedly derives the conductivity o and / or the impedance Z value of the fluid that passes through the measurement chamber 160 at each of the first and second measurement electrode pairs 110 and 120 respectively and the conductivity o and / or the impedance Z value of the milk of the fluid that passes the reference electrode pair 170, and further based thereon repeatedly derives an update of the milk-filling factor FF(t) at each of the first and second measurement electrode pairs 110 and 120 respectively and repeatedly derives an update of the speed v(t) of the fluid that passes through measurement chamber 160.
[0072] In addition to the updates of the increments AW(t) of the weight of the vessel 260, the training unit 200 repeatedly obtains the updates of the milk-filling factor FF(t) and the speed v(t).
[0073] Based on these parameters as training data, i.e. the updates of the increments AW(t) of the weight of the vessel 260 and the repeated updates of the milk-filling factor FF(t) and the speed v(t), the training unit 200 trains the ANN 180’ until a convergence criterion is fulfilled.
[0074] According to one embodiment of the invention, a time reference source 270 is configured to provide a common time reference tR to each of the scale 265 and the processing unit 150 respectively. Moreover, the scale 265 is configured to produce the updates of the increments AW(t) of the weight of the vessel 260 in synchronization with the common time reference tR, and the processing unit 150 is configured to produce the updates of the milk-filling factor FF(t) and the speed v(t) in synchronization with the common time reference tR. Additionally, the training unit 200 is configured to train the ANN under training 180’ in a synchronized manner based on the common time reference tR, i.e. so that the pieces of training data AW(t), FF(t) and v(t) are temporally coordinated with one another.
[0075] Initially, a set of weights wi, ..., wj, between the nodes 410 in the ANN under training 180’ may have arbitrary values, for example by all being equal. According to one embodiment of the invention, the values of the weights wi, wy in the ANN under training 180’ are determined iteratively via a backpropagation training process that involves comparing the updates of the increments AW(t) of the weight of the vessel 260 with the outputs AW’(t) from the ANN under training 180’, which outputs AW’(t) express updated estimates of the increments of the weight of the vessel 260 that are produced by the ANN under training 180’ based on training data expressing the updates of the milk-filling factor FF(t) and the speed v(t). The training unit 200 preferably trains the ANN under training 180’ by employing an evaluation module 310 configured to check if a difference A between the output AW’(t) from the ANN under training 180’ and increments AW(t) of the weight of the vessel 260 is less than a threshold value eth. If the evaluation module 310 finds that said difference Ais equal to or larger than a threshold value eth, the evaluation module 310 is configured to generate a set of adjustment parameters {P}, which causes one or more of the weights wi, ... , Wij to be modified to a respective higher or lower value that are expected to lower the difference A. This backpropagation training process continues until a convergence criterion is met. In simplified terms this may be said to occur when the difference A becomes smaller than the threshold value eth. According to embodiments of the invention, the backpropagation training process requires 80 to 120 epochs. Preferably, the training process encompasses around 100 epochs to train the ANN under training 180’. It is advantageous if the ANN under training 180’ includes a Gaussian-noise layer after the input layer IL. This namely introduces an amount of random noise that may assist convergence of the training process.
[0076] According to one embodiment of the invention, the trained ANN 180 is a fully connected multilayer neural network that has one input layer IL, for example with two nodes adapted to receive values of the milk-filling factor FF and the speed v respectively, one output layer OL, for example with one node adapted to provide updates of the increments AW(t), and at least four hidden layers HL interconnecting the input and output layers IL and OL respectively. Prefer- ably, the trained ANN 180 is a multilayer perceptron comprising up to 6 hidden layers HL. Naturally, this means that the ANN under training 180’ likewise is a multilayer perceptron comprising up to 6 hidden layers HL.
[0077] In addition, the trained ANN 180 preferably has input and output interfaces 405 and 415 respectively, where the input interface 405 is configured to obtain input data in the form of the milk-filling factor FF and the speed v respectively, and the output interface 415 is configured to provide the estimated updates of the weight AW’(t). Here, the output interface 415 is preferably further configured to convert the estimated updates of the weight AW’(t) into milk-flow rate values Q.
[0078] According to one embodiment of the invention, the trained ANN 180 is implemented by means of a computer program that runs on at least one processing unit, for example in the processing device 150.
[0079] According to another embodiment of the invention, the trained ANN 180 is instead implemented in hardware, such as in one or more neuromorphic circuit, i.e. mixed-signal integrated circuit containing both analog circuits and digital circuits, which aims at mimicking biological neural functions.
[0080] Returning now to Figure 1 , it is generally advantageous if the processing device 150 is configured to effect the above procedure in an automatic manner by executing a computer program. Therefore, the processing device 150 may include at least one processing unit 151 and a memory unit 155, i.e. non-volatile data carrier, storing a computer program 153, which, in turn, contains software for making the at least one processing unit 151 execute the actions mentioned in this disclosure when the computer program 153 is run on the at least processing unit 151.
[0081] To sum up, and with reference to the flow diagram in Figure 6, we will now describe the computer-implemented method according to the invention for determining a milk-flow rate Q of a fluid that comprises milk or a mixture of milk and gas through a measurement chamber 160 during a milking session for an animal.
[0082] In a first step 610, a stream of data obtained from a measurement unit 130, which stream of data reflects at least one electrical characteristic of the fluid that passes through the measurement chamber 160. The measurement unit 130 supplies probing signals to first and second measurement electrode pairs 1 10 and 120 respectively and a reference electrode pair 170 in the measurement chamber 160, obtains from each of the first and second measurement electrode pairs 1 10 and 120 respectively and the reference electrode pair 170 a respective resulting signal, and based thereon determines the at least one electrical characteristic included in the stream of data RD.
[0083] Based on the stream of data RD, in a subsequent step 620, a conductivity o and / or an impedance Z value of the fluid that passes through the measurement chamber 160 is derived at each of the first and second measurement electrode pairs 1 10 and 120 respectively.
[0084] Subsequently, in a step 630, a milk-filling factor FF in measurement chamber 160 and a speed v of the fluid that passes through the measurement chamber 160 and a speed v of the fluid that passes through the measurement chamber are derived based on said conductivity o and / or the impedance Z values. The deriving of the milk-filling factor FF involves comparing, the conductivity o and / or the impedance Z value of the fluid at the first measurement electrode pair 1 10 with the conductivity o and / or the impedance Z value of the milk of the fluid at the reference electrode pair 170 to obtain a value of a first test parameter T 1 . The deriving of the milk-filling factor FF further involves comparing, repeatedly, the conductivity o and / or the impedance Z value of the fluid at the second measurement electrode pair 120 with the conductivity o and / or the impedance Z value of the milk of the fluid at the reference electrode pair 170 to obtain a value of a second test parameter T2. The deriving of the speed v involves mapping a first series of values 510 against a second series of values 520 in a set of temporal windows 501 , 502, ... , 50n, which first series of values 510 comprises the values of the first test parameter T1 in the set of temporal windows 501 , 502, ... , 50n, and which second series of values 520 comprises the values of the second test parameter T2 in the set of temporal windows 501 , 502, ... , 50n.
[0085] Thereafter, in a step 640, a value of a milk-flow rate Q is determined by means of a trained ANN 180. The trained ANN 180 is configured to determine the milk-flow rate Q based on the milk-filling factor FF in the measurement chamber 160 and the speed v of the fluid that passes through the measurement chamber 160.
[0086] Subsequently, the procedure loops back to step 610.
[0087] For illustrating purposes the procedure has been described above in a strict sequential order. However, of course, in practice, all the steps 610 to 640 are executed in parallel, such that for example, while the values of the conductivity o and / or the impedance Z are derived in step 620, the stream of data RD is continued to be received in step 610, and so on.
[0088] The process steps described with reference to Figure 6 may be controlled by means of a programmed processor. Moreover, although the embodiments of the invention described above with reference to the drawings comprise processor and processes performed in at least one processor, the invention thus also extends to computer programs, particularly computer programs on or in a carrier, adapted for putting the invention into practice. The program may be in the form of source code, object code, a code intermediate source and object code such as in partially compiled form, or in any other form suitable for use in the implementation of the process according to the invention. The program may either be a part of an operating system or be a separate application. The carrier may be any entity or device capable of carrying the program. For example, the carrier may comprise a storage medium, such as a Flash memory, a ROM (Read Only Memory), for example a DVD (Digital Video / Versatile Disk), a CD (Compact Disc) or a semiconductor ROM, an EPROM (Erasable Programmable Read-Only 2Q
[0089] Memory), an EEPROM (Electrically Erasable Programmable Read- Only Memory), or a magnetic recording medium, for example a floppy disc or hard disc. Further, the carrier may be a transmissible carrier such as an electrical or optical signal which may be conveyed via electrical or optical cable or by radio or by other means. When the program is embodied in a signal, which may be conveyed, directly by a cable or other device or means, the carrier may be constituted by such cable or device or means. Alternatively, the carrier may be an integrated circuit in which the program is embedded, the integrated circuit being adapted for performing, or for use in the performance of, the relevant processes.
[0090] Variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a study of the drawings, the disclosure, and the appended claims.
[0091] The term “comprises / comprising” when used in this specification is taken to specify the presence of stated features, integers, steps or components. The term does not preclude the presence or addition of one or more additional elements, features, integers, steps or components or groups thereof. The indefinite article "a" or "an" does not exclude a plurality. In the claims, the word “or” is not to be interpreted as an exclusive or (sometimes referred to as “XOR”). On the contrary, expressions such as “A or B” covers all the cases “A and not B”, “B and not A” and “A and B”, unless otherwise indicated. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. Any reference signs in the claims should not be construed as limiting the scope.
[0092] It is also to be noted that features from the various embodiments described herein may freely be combined, unless it is explicitly stated that such a combination would be unsuitable.
[0093] The invention is not restricted to the described embodiments in the figures, however, may be varied freely within the scope of the claims.
Claims
Claims1. A method for determining a milk-flow rate (Q) of a fluid comprising milk or a mixture of milk and gas through a measurement chamber (160) during a milking session for an animal, which milkflow rate (Q) represents an estimated amount of milk per unit time (t) that passes through the measurement chamber (160) in which a reference electrode pair (170) is arranged and first and second measurement electrode pairs (110, 120) are arranged in series with one another, wherein each of the first and second measurement electrode pairs (110, 120) comprises a respective first and second electrode (111 , 112; 121 , 122) which each is arranged in the measurement chamber (160) such that each of the first and second electrode surrounds a cross section of the measurement chamber (160), and wherein the reference electrode pair (170) comprises first and second reference electrodes (171 , 172) which each is arranged in the measurement chamber (160) to make electrical contact with the milk of the fluid in the measurement chamber (160), the method comprising: obtaining, from a measurement unit (130), a stream of data (RD) reflecting at least one electrical characteristic of the fluid that passes through the measurement chamber (160), which measurement unit (130) is configured to supply probing signals to the first and second measurement electrode pairs (110; 120) and the reference electrode pair (170), obtain from each of the first and second measurement electrode pairs (110; 120) and the reference electrode pair (170) a respective resulting signal and based thereon determine the at least one electrical characteristic; deriving, based on the stream of data (RD) and using a processing device (150), a conductivity (o) and / or an impedance (Z) value of the fluid that passes through the measurement chamber (160) at each of the first and second measurement electrode pairs (110, 120) respectively; and deriving, based on said conductivity (o) and / or the impedance (Z) values and using the processing device (150), a milk-filling factor (FF) in the measurement chamber (160) and a speed (v) of the fluid that passes through the measurement chamber (160), thederiving of the milk-filling factor (FF) comprising: comparing, repeatedly, the conductivity (o) and / or the impedance (Z) value of the fluid at the first measurement electrode pair (110) with the conductivity (o) and / or the impedance (Z) value of the milk of the fluid at the reference electrode pair (170) to obtain a value of a first test parameter (T1 ), and comparing, repeatedly, the conductivity (o) and / or the impedance (Z) value of the fluid at the second measurement electrode pair (120) with the conductivity (o) and / or the impedance (Z) value of the milk of the fluid at the reference electrode pair (170) to obtain a value of a second test parameter (T2); and the deriving of the speed (v) comprising: mapping a first series of values (510) against a second series of values (520) in a set of temporal windows (501 , 502, 50n), which first series of values (510) comprises the values of the first test parameter (T1 ) in the set of temporal windows (501 , 502, 50n), and which second series of values (520) comprises the values of the second test parameter (T2) in the set of temporal windows (501 , 502, 50n), characterized by determining, repeatedly, by means of a trained artificial neural network, ANN, (180), the milk-flow rate (Q), which trained ANN (180) is configured to determine the milk-flow rate (Q) based on the milk-filling factor (FF) in the measurement chamber (160) and the speed (v) of the fluid that passes through the measurement chamber (160).
2. The method according to claim 1 , wherein the milk-filling factor (FF) is a number between 0 and 1 , where:0 designates that no milk is present at the position in the measurement chamber (160) where the first or second measurement electrode pair respectively (110; 120) is located,1 designates that the measurement chamber (160) is completely filled with milk at the position where the measurement electrode pair (110; 120) is located, anda number between 0 and 1 designates that the fluid comprises the mixture of milk and gas at the position where the measurement electrode pair (110; 120) is located.
3. The method according to claim 2, wherein: the first test parameter (T1 ) is obtained as a ratio between the conductivity (o) and / or the impedance (Z) value of the fluid at the first measurement electrode pair (110) and the conductivity (o) and / or the impedance (Z) value of the milk of the fluid at the reference electrode pair (170), and the second test parameter (T2) is obtained as a ratio between the conductivity (o) and / or the impedance (Z) value of the fluid at the second measurement electrode pair (120) and the conductivity (o) and / or the impedance (Z) value of the milk of the fluid at the reference electrode pair (170).
4. The method according to any one of the preceding claims, wherein the speed (v) is derived by a process that comprises: determining a temporal difference (At) between the first and second series of values (510; 520) based on said mapping, which temporal difference (At) expresses an estimated delay for the fluid to pass between the first and second measurement electrode pairs (110, 120); and calculating the speed (v) as a distance (d2) between the first and second measurement electrode pairs (110, 120) divided by the estimated delay.
5. The method according to any one of the preceding claims, wherein each temporal window in the set of temporal windows (501 , 502, 50n) has an extension (E) in time (t) in a range from one to ten seconds, preferably around five seconds.
6. The method according to claim 5, wherein each temporal window (502) in the set of temporal windows (501 , 502, 50n) has a stride (ST) with respect to a previous temporal window (501) in the set of temporal windows (501 , 502, 50n), which stride (ST) is in arange from 10 % to 50 %, preferably around 20 %, of the extension (E) in time (t) of each temporal window in the set of temporal windows (501 , 502, 50n).
7. The method according to any of claims 5 or 6, wherein each temporal window (502) in the set of temporal windows (501 , 502, 50n) has an overlap (OP) with respect to a previous temporal window (501 ) in the set of temporal windows (501 , 502, 50n), which overlap (OP) is in a range from 50 % to 80 %, preferably around 60 %, of the extension (E) in time (t) of each temporal window in the set of temporal windows (501 , 502, 50n).
8. The method according to any one of claims 6 or 7, wherein the method comprises: determining, repeatedly, an updated value of the milk-flow rate (Q), wherein the updated value of the milk-flow rate (Q) is determined at a frequency that is inversely proportional to an extension in time (t) of the stride (ST).
9. The method according to any of the preceding claims, wherein the values in the first second series (510, 520) that represent each of the first and second test parameters (T 1 ; T2) respectively are quantified in a number of discrete levels (L0, L1 , L2, L3, L4, L5, L6, L7), which number is in a range from 4 to 64, and preferably in a range from 8 to 16.
10. The method according to any one of the preceding claims, wherein before mapping the first series of values (510) against the second series of values (520), the method comprises: normalizing each of the first and second series of values (510; 520).
11. The method according to any one of the preceding claims, further comprising: deriving, based on the milk-flow rate (Q) and a duration of the milking session for the animal and using the processing device(150), a total milk yield (Y) extracted during the milking session.
12. A computer program (153) loadable into a non-volatile data carrier (155) communicatively connected to a processing unit (151 ), the computer program (153) comprising software for executing the method according to any one of the preceding claims when the computer program (153) is run on the processing unit (151 ).
13. A non-volatile data carrier (155) containing the computer program (153) of the claim 12.
14. A sensor arrangement (190) for determining a milk-flow rate (Q) of a fluid comprising milk or a mixture of milk and gas through a conduit (165) during a milking session for an animal, which milkflow rate (Q) represents an estimated amount of milk per unit time (t) that passes through the conduit (165), the arrangement comprising: a sensor device (140) arranged on the conduit (165) such that the fluid passes through the sensor device (140) via the conduit (165), which sensor device (140) comprises a measurement chamber (160) configured to measure the milk-flow rate (Q) in which measurement chamber (160) a reference electrode pair (170) is arranged and first and second measurement electrode pairs (110, 120) are arranged in series with one another, wherein each of the first and second measurement electrode pairs (110, 120) comprises a respective first and second electrode (111 , 112; 121 , 122) which each is arranged in the measurement chamber (160) such that the electrode surrounds a cross section of the measurement chamber (160), and wherein the reference electrode pair (170) comprises first and second reference electrodes which each is arranged in the measurement chamber (160) to make electrical contact with the milk of the fluid in the measurement chamber (160), where each of the first and second reference electrodes respectively is arranged, a measurement unit (130) configured to produce a stream of data (RD) reflecting at least one electrical characteristic of the fluidthat passes through the measurement chamber (160), the stream of data (RD) being produced by supplying probing signals to the first and second measurement electrode pairs (110; 120) and the reference electrode pair (170), obtaining from each of the first and second measurement electrode pairs (110; 120) and the reference electrode pair (170) a respective resulting signal and based thereon determine the at least one electrical characteristic; a processing device (150) configured to: obtain the stream of data (RD), and based thereon derive a conductivity (o) and / or an impedance (Z) value of the fluid that passes through the measurement chamber (160) at each of the first and second measurement electrode pairs (110, 120) respectively; and derive, repeatedly, based on said conductivity (o) and / or impedance (Z) values, a milk-filling factor (FF) in measurement chamber (160) and a speed (v) of the fluid that passes through measurement chamber (160), the deriving of the milk-filling factor (FF) comprising comparing, repeatedly, the conductivity (o) and / or the impedance (Z) value of the fluid at the first measurement electrode pair (110) with the conductivity (o) and / or the impedance (Z) value of the milk of the fluid at the reference electrode pair (170) to obtain a value of a first test parameter (T1 ), and comparing, repeatedly, the conductivity (o) and / or the impedance (Z) value of the fluid at the second measurement electrode pair (120) with the conductivity (o) and / or the impedance (Z) value of the milk of the fluid at the reference electrode pair (170) to obtain a value of a second test parameter (T2); and the deriving of the speed (v) comprising mapping a first series of values (510) against a second series of values (520) in a set of temporal windows (501 , 502, 50n), which first series of values (510) comprises the values of the first test parameter (T1 ) in the set of temporal windows (501 , 502, 50n), and which second series of values (520) comprises the values of the second test parameter (T2) in the set of temporal windows (501 , 502,characterized in that the arrangement comprises: a trained artificial neural network, ANN, (180) configured to repeatedly determine the milk-flow rate (Q) based on the milk-filling factor (FF) in the measurement chamber (160) and the speed of (v) the fluid that passes through the measurement chamber (160).
15. The sensor arrangement (190) according to claim 14, wherein each of the first and second reference electrodes (171 , 172) is arranged in the measurement chamber (160) to make electrical contact with the milk of the fluid in the measurement chamber (160) at a respective lowest point of a cross-section of the measurement chamber (160) where each of the first and second reference electrodes respectively is arranged.
16. The sensor arrangement (190) according to any one of claims 14 or 15, wherein the trained ANN (180) is a fully connected multilayer neural network comprising: one input layer (IL), one output layer (OL), and at least four hidden layers (HL) interconnecting the input and output layers (IL; OL).
17. The sensor arrangement (190) according to claim 16, wherein the trained ANN (180) is a multilayer perceptron comprising up to 6 hidden layers (HL).
18. The sensor arrangement (190) according to any one of claims 14 to 17, wherein the trained ANN (180) is implemented by means of a computer program run on at least one processing unit.
19. The sensor arrangement (190) according to any one of claims 14 to 17, wherein the trained ANN (180) is implemented on at least one neuromorphic circuit.
20. The sensor arrangement (190) according to any one of claims 14 to 19, wherein the measurement unit (130), the processingdevice (150) and the trained ANN (180) are comprised in the sensor arrangement (190).21 . The sensor arrangement (190) according to any one of claims 14 to 20, wherein the trained ANN (180) has been trained through a process wherein, during at least one milking session for an animal: milk is extracted from the animal by using a milking equipment (210), a fluid comprising the extracted milk or a mixture of the extracted milk and gas is fed from the milking equipment (210) through the sensor device (140) via a conduit (165) into a vessel (260), a scale (265) repeatedly registers a weight of the vessel (260); a training unit (200) repeatedly obtains from the scale (265) updates of increments (AW(t)) of the weight of the vessel (260), which increments (AW(t)) result from amounts of the extracted milk entering the vessel (260); the measurement unit (130) supplies probing signals to the first and second measurement electrode pairs (110; 120) and the reference electrode pair (170), obtains from each of the first and second measurement electrode pairs (110; 120) and the reference electrode pair (170) a respective resulting signal, and based thereon determines the at least one electrical characteristic; and the processing device (150) obtains the stream of data (RD), and based thereon repeatedly derives the conductivity (o) and / or the impedance (Z) value of the fluid that passes through the measurement chamber (160) at each of the first and second measurement electrode pairs (110, 120) respectively and the conductivity (o) and / or the impedance (Z) value of the extracted milk of the fluid that passes the reference electrode pair (170) and further based thereon repeatedly derives an update of the milk-filling factor (FF(t)) at each of the first and second measurement electrode pairs (110, 120) and an update of the speed (v(t)) of the fluid that passes through measurement chamber (160), wherein the training unit (200) further repeatedly obtains the updates of the milk-filling factor (FF(t)) and the speed (v(t)), and basedthereon, and in conjunction with said updates of the increments (AW(t)) of the weight, trains an ANN under training (180’) until a convergence criterion is fulfilled.
22. The sensor arrangement (190) according to claim 21 , further comprising: a time reference source (270) configured to provide a common time reference (tR) to each of the scale (265) and the processing unit (150) respectively, wherein the scale (265) is configured to produce the updates of the increments (AW(t)) of the weight of the vessel (260) in synchronization with the common time reference (tR), the processing unit (150) is configured to produce the updates of the milk-filling factor (FF(t)) and the speed (v(t)) in synchronization with the common time reference (tR), and the training unit (200) is configured to train the ANN under training (180’) in a synchronized manner based on the common time reference (tR).
23. The sensor arrangement (190) according to any one of claims 21 or 22, wherein the ANN under training (180’) has weights (wi, ... , Wij), which are determined iteratively via a backpropagation training process ({P}) comprising comparing the updates of the increments (AW(t)) of the weight of the vessel (260) with outputs (AW’(t)) from the ANN under training (180’), which outputs (AW’(t)) express updated estimates of the increments of the weight of the vessel (260) produced by the ANN under training (180’) based on training data expressing the updates of the milk-filling factor (FF(t)) and the speed (v(t)).
24. The sensor arrangement (190) according to claim 23, wherein the backpropagation training process ({P}) comprises 80 to 120 epochs, preferably around 100 epochs.
25. The sensor arrangement (190) according to any one of claims 23 or 24, wherein the ANN under training (180’) comprises a Gaussian-noise layer after the input layer (IL).
Citation Information
Patent Citations
A device and method for detecting milk yield in dairy cows based on neural networks.
CN107006377B
Milk meter
US10598528B2
Device for determining a mass flow rate of a fluid in a channel by measuring electrical conductivity using electrodes
US9470565B2
Multiphase flow measurement
US20140260660A1
Milk meter
US20190145805A1
Cited By
Electromagnetic breast milk flow meter with biological impedance correction and metering method thereof
CN121855634A