Key points
- Sensors can capture many measurements from every cow in the herd every day.
- Adoption of data-capture technologies on New Zealand dairy farms is generally low, especially for mastitis detection.
- Current mastitis detection systems leave room for improvement in either performance or cost.
- Advances in sensor technologies and incorporating data from multiple sensors may improve detection, leading to greater adoption rates.
Investing in sensors or wearable technologies isn’t at the forefront of most dairy farmers' minds. While current technologies can provide regular measures of cow performance and/or behaviour, adoption rates are generally low. Automated detection of diseases such as mastitis is challenging, with systems limited in their ability to act as an early warning system. However, there is potential for effective, low-cost detection systems to have significant impacts on herd health and performance.
Sensor technologies
Greater automation of dairy farm practices has been apparent in recent decades, reducing the reliance on labour and assisting large herd management. There’s now an opportunity to collect enormous amounts of data using less expensive sensors. This provides the ability to tease out patterns, trends, and associations relating to individual cow milk production and activity over time.
Farmers who have adopted sensor technologies typically see daily herd summaries and can be alerted to all sorts of changes, e.g. lists of cows that are in heat or suspected of having a health disorder. In-built alerts are based on algorithms designed by manufacturers, but all the data that lurks in the background could be put to greater use.
The limitations are no greater than in automated mastitis detection. Mastitis is a difficult disease to identify, and neither human nor sensor will be 100 percent accurate. The greatest challenge for common detection systems is the number of false alerts, which can cause farmers to lose trust in the system1. Additionally, mastitis alerts are limited in their ability to inform treatment decisions.
In this article, we consider a range of sensors that can collect data on an individual cow basis, and how these data relate to mastitis. The more we understand about the changes occurring before clinical mastitis is visually detected, the better armed we are to improve mastitis detection systems in the future.
Technology adoption on NZ dairy farms
According to DairyNZ’s 2018 farmer survey, rotaries are more likely to have incorporated sensor technologies compared with herringbone sheds. These technologies include milk meters, walk-over weighers, and mastitis and heat detection systems. The level of adoption is also increasing at a faster rate for rotaries, though the uptake of data-capture technologies is low. Barriers to adoption in New Zealand include uncertainty of the benefits of a sensor, potential future improvements in current sensors which delay investment, suitability to seasonal and grazing systems, and other investment priorities2.
Progression of mastitis infections
Mastitis is an inflammation of the mammary gland, usually occurring in response to bacteria that entered through the teat canal. Bacteria enter the ductal network, stick to the milk-producing cells (mammary epithelial cells), multiply, and release toxins (Figure 1). The immune system recognises bacteria and generates an inflammatory response. The combined efforts of bacteria and the immune system cause damage to mammary tissue, breaching the barrier that separates milk from blood within the mammary gland.
At this stage, the milker and various devices can detect changes in milk appearance, milk composition and sometimes cow behaviour. Each of these can be telling signs of inflammation, i.e. mastitis. The infection may be in a sub-clinical phase or pre-clinical phase, when mastitis cannot be detected by eye.
What causes mastitis?
With more than 140 different species of bacteria linked to mastitis in dairy cows4, accurate and timely detection can be difficult. To assist with bacteria identification, we can broadly split bacteria into Gram-positive and Gram-negative bacteria (diagnosed by the Gram-stain procedure shown in Figure 2). By basing this on the way the bacteria are recognised by (and stimulate) the immune system, we can hone in on the differences between mastitis infections.
Infections due to Gram-positive bacteria might exist in a sub-clinical phase before progressing to a visible clinical infection. These typically respond well to antibiotic therapy (e.g. Streptococcus uberis). An exception is the Gram-positive contagious bacterium, Staphylococcus aureus, which can hide from the immune system and cause chronic infections, which often result in low cure rates when treated with antibiotics5.
Gram-negative bacteria, such as Escherichia coli, commonly found in the environment and faeces, cause more problems in confinement systems. Most E. coli infections are short term with a rapid onset but with an equally rapid recovery (often without requiring antibiotic treatment).


Figure 2: Comparison of Gram-positive (stains purple) and Gram-negative (stains pink) bacteria under the microscope (reference 6).
Sensor measures and mastitis
Sensors offer the ability to detect cows with mastitis without the physical task of regularly teat-stripping the herd, and systems currently do this, but the performance is variable. Sensors might also detect changes before clinical signs are present. If accurate, this provides opportunity for early intervention, if required. Sensors useful in modern dairy farming can be attached to the cow (i.e. worn on the body) or in the milking systems (often known as ‘inline’ or ‘online’). Some inline sensors continuously measure milk from the beginning of milk flow to the end of milking, whereas an online sensor might sample a small amount of milk to measure the components of interest7.
- Somatic cell count (SCC)
The SCC of milk increases during mastitis as the immune (somatic) cells are recruited from blood to milk to fight against the bacteria. To measure SCC online, somatic cells in a small sample of milk can either be counted directly (by a machine), or indirectly estimated, e.g. by measuring the viscosity or ‘gooeyness’ of the milk. The latter requires addition of a detergent, causing the DNA from within somatic cells to clump together (it’s an automated Rapid Mastitis Test).
- Electrical conductivity
Electrical conductivity describes the ability of milk to carry an electric current. Milk from a healthy cow contains low concentrations of sodium and chloride ions, but when the blood/milk barrier is breached these ions can move from blood into the milk.


Figure 3: Changes in electrical conductivity of uninfected and infected milk in the days before and after clinical mastitis detection on day 0 (Steele, unpublished).
Because these ions carry a charge, they increase the conductivity of the milk during mastitis. Since the 1940s, conductivity has been used in mastitis detection, firstly by hand-held meters, and later, through inline sensors1. Changes in conductivity can be observed four days before clinical mastitis is visually detected (Figure 3), although this depends on how severe the infection is and the type of bacteria responsible. However, the conductivity of milk is affected by factors other than mastitis, including temperature and milk fat content. On its own, conductivity has not provided a reliable indicator of mastitis, but performance is improved when comparing conductivity of quarters within a cow8.


Figure 4: Changes in lactose percentage of uninfected and infected milk in the days before and after clinical mastitis detection on day 0 (Steele, unpublished).
- Milk yield and components
Milk yield declines due to mastitis, but the size of the decline depends on the severity of the infection and the pathogen causing the infection, as well as the age of the cow and her stage of lactation9. Milk yield is a non-specific indicator of mastitis, because decreased milk production can occur for many reasons but it is useful when considered in combination with other mastitis-related parameters.
Inline sensors can measure milk lactose, protein, fat, and various enzymes. Lactose percentage declines in response to mastitis, whereas changes in protein and fat percent are not as clear-cut.
In a normally functioning mammary gland, the milk sugar (lactose) is present in milk at about 4.8 percent. During mastitis, lactose can escape from the milk as part of the blood/milk barrier breach. The ability of milk-producing cells to produce lactose is also compromised during mastitis due to reduced function, or even cell death. The decline in lactose during Gram-negative infections (e.g. E. coli) is more drastic than for Gram-positive infections (e.g. Strep. uberis; Figure 4). In contrast, lactose percentage in healthy cows remains stable over time, providing quite a good indicator of infection.
- Cow behaviour
As cows are prey animals, they use various behaviours to disguise sickness, especially pain. A cow will typically spend 10 to 12 hours lying per day. Changes in cows’ time spent lying have been observed five days prior to clinical mastitis detection, varying within pathogen type and infection severity10, 11.
Feeding behaviour and walking activity changes can also indicate disease. Considering behavioural changes in combination with milk composition changes will likely improve mastitis detection.
Future opportunities
Individual changes in milk-associated and behavioural parameters alone can be too vague to accurately indicate mastitis without an unacceptable number of false alerts. Combining data from different sensors can help form a much clearer picture and greater predictive ability. Eventually sensor systems could progress to the point where we can not only detect mastitis early, we can identify the bacteria type, improving treatment and other management decisions. Looking ahead, as sensor accuracy and data quality and recording improves, mastitis detection systems using sensors can only get better.
This focus is shared by the Pillars of a New Dairy System research programme. This programme is collecting activity data in a non-invasive manner to identify cows with sub-clinical diseases around the transition period. Ultimately, this research will contribute to greater lifetime productivity of cows.
Read about this research in Inside Dairy December 2018, page 18 and find out more about the dairynz.co.nz/pillars programme.
Acknowledgements
This report describes some of Nicole Steele’s PhD programme which was funded by New Zealand dairy farmers through DairyNZ in partnership with Virginia Tech (USA) and with financial assistance from the Virginia Agricultural Council.
References
- Rutten, C. J., A. G. J. Velthuis, W. Steeneveld, and H. Hogeveen. 2013. Invited review: Sensors to support health management on dairy farms. Journal of Dairy Science 96(4):1928-1952.
- Rutten, C. J., W. Steeneveld, A. G. J. M. Oude Lansink, and H. Hogeveen. 2018. Delaying investments in sensor technology: The rationality of dairy farmers' investment decisions illustrated within the framework of real options theory. Journal of Dairy Science 101:7650-7660.
- Viguier, C., S. Arora, N. Gilmartin, K. Welbeck, and R. O’Kennedy. 2009. Mastitis detection: current trends and future perspectives. Trends in biotechnology 27(8):486-493.
- Watts, J. L. 1988. Etiological agents of bovine mastitis. Veterinary Microbiology 16(1):41-66.
- Barkema, H., M. Green, A. Bradley, and R. Zadoks. 2009. Invited review: The role of contagious disease in udder health. Journal of Dairy Science 92(10):4717- 4729.
- Karki, G. 2018. Difference between Gram positive and Gram negative bacteria. Online biology notes. Accessed March 29, 2019 from https://www.onlinebiologynotes.com/difference-between-gram-positive-and-gram-negative-bacteria/
- Penry, J. F. 2018. Mastitis control in automatic milking systems. Veterinary Clinics of North America Food Animal Practice 34(3):439-456.
- Nielen, M., H. Deluyker, Y. H. Schukken, and A. Brand. 1992. Electrical conductivity of milk: measurement, modifiers, and meta analysis of mastitis detection performance. Journal of Dairy Science 75(2):606-614.
- Gröhn, Y. T., D. J. Wilson, R. N. Gonzalez, J. A. Hertl, H. Schulte, G. Bennett, and Y. H. Schukken. 2004. Effect of pathogen-specific clinical mastitis on milk yield in dairy cows. Journal of Dairy Science 87(10):3358-3374
- Stangaferro, M. L., R. Wijma, L. S. Caixeta, M. A. Al-Abri, and J. O. Giordano. 2016. Use of rumination and activity monitoring for the identification of dairy cows with health disorders: Part II. Mastitis. Journal of Dairy Science 99(9):7411-7421.
- King, M., S. Le Blanc, E. Pajor, T. Wright, and T. DeVries. 2018. Behavior and productivity of cows milked in automated systems before diagnosis of health disorders in early lactation. Journal of Dairy Science 101(5):4343-4356.
This article was originally published in Technical Series June 2019