Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Aug 7;25(15):4865.
doi: 10.3390/s25154865.

An AI-Driven Multimodal Monitoring System for Early Mastitis Indicators in Italian Mediterranean Buffalo

Affiliations

An AI-Driven Multimodal Monitoring System for Early Mastitis Indicators in Italian Mediterranean Buffalo

Maria Teresa Verde et al. Sensors (Basel). .

Abstract

Mastitis is a significant challenge in the buffalo industry, affecting both milk production and animal health and resulting in economic losses. This study presents the first fully automated AI-driven thermal imaging system integrated with robotic milking, specifically developed for the real-time, non-invasive monitoring of udder health in Italian Mediterranean buffalo. Unlike traditional approaches, the system leverages the synchronized acquisition of thermal images during milking and compensates for environmental variables through a calibrated weather station. A transformer-based neural network (SegFormer) segments the udder area, enabling the extraction of maximum udder skin surface temperature (USST), which is significantly correlated with somatic cell count (SCC). Initial trials demonstrate the feasibility of this approach in operational farm environments, paving the way for scalable, precision diagnostics of subclinical mastitis. This work represents a critical step toward intelligent, automated systems for early detection and intervention, improving animal welfare and reducing antibiotic use.

Keywords: artificial intelligence (AI); early disease detection; infrared thermography; instrument and measurements; machine learning; udder health.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflicts of interest.

Figures

Figure 1
Figure 1
Pictures from the buffalo farm, equipped with a milking robot, in Cancello ed Arnone.
Figure 2
Figure 2
Installation of the thermal camera in the milking robot and example of acquired infrared image.
Figure 3
Figure 3
Automatic measurement station setup.
Figure 4
Figure 4
Thermal camera control device.
Figure 5
Figure 5
General synchronization system.
Figure 6
Figure 6
Diagram for the correct timing in infrared image capturing.
Figure 7
Figure 7
Examples of acquired infrared images: (a) anticipated capturing, (b) perfect timing, (c,d) delayed capturing.
Figure 8
Figure 8
Finite state machine for system control.
Figure 9
Figure 9
Example of hand-determination of the udder ROI.
Figure 10
Figure 10
Depiction of the SegFormer architecture at a high level.
Figure 11
Figure 11
Ground truth obtained through experts labeling images in Label Studio.
Figure 12
Figure 12
Comparison of the mIoU score over the test set for different configurations explored by the Bayesian optimizer.
Figure 13
Figure 13
Plot of detection accuracy at varying IoU thresholds.
Figure 14
Figure 14
An example comparing the predicted segmentation mask by the AI model to the actual mask detected by the veterinaries: correctly segmented areas are green, incorrectly unsegmented areas are blue, and incorrectly segmented areas are red; a white square indicates the maximum temperature location in the predicted mask, while a white circle marks the corresponding location in the actual mask.
Figure 15
Figure 15
Comparison of udder maximum temperatures detected by our system and actual ones for cases where the temperatures do not coincide.
Figure 16
Figure 16
Boxplot of the measured udder maximum temperature for the two OCC groups.
Figure 17
Figure 17
Raw data plot for buffalo with ID 969.
Figure 18
Figure 18
Raw data plot for buffalo with ID 981.
Figure 19
Figure 19
Raw data plot for buffalo with ID 1033.
Figure 20
Figure 20
Raw data plot for buffalo with ID 1059.
Figure 21
Figure 21
Raw data plot for buffalo with ID 1526.
Figure 22
Figure 22
Raw data plot for buffalo with ID 1547.

Similar articles

References

    1. Harmon R. Physiology of mastitis and factors affecting somatic cell counts. J. Dairy Sci. 1994;77:2103–2112. doi: 10.3168/jds.S0022-0302(94)77153-8. - DOI - PubMed
    1. Moreira L.H., de Souza J.C.P., de Lima C.J., Salgado M.A.C., Fernandes A.B., Andreani D.I.K., Villaverde A.B., Zângaro R.A. Use of photodynamic therapy in the treatment of bovine subclinical mastitis. Photodiagn. Photodyn. Ther. 2018;21:246–251. doi: 10.1016/j.pdpdt.2017.12.009. - DOI - PubMed
    1. Zecconi A., Scali F. Staphylococcus aureus virulence factors in evasion from innate immune defenses in human and animal diseases. Immunol. Lett. 2013;150:12–22. doi: 10.1016/j.imlet.2013.01.004. - DOI - PubMed
    1. Moroni P., Rossi C.S., Pisoni G., Bronzo V., Castiglioni B., Boettcher P. Relationships between somatic cell count and intramammary infection in buffaloes. J. Dairy Sci. 2006;89:998–1003. doi: 10.3168/jds.S0022-0302(06)72165-8. - DOI - PubMed
    1. Tripaldi C., Palocci G., Miarelli M., Catta M., Orlandini S., Amatiste S., Bernardini R.D., Catillo G. Effects of mastitis on buffalo milk quality. Asian-Australas. J. Anim. Sci. 2010;23:1319–1324. doi: 10.5713/ajas.2010.90618. - DOI

LinkOut - more resources