This Small Business Innovation Research (SBIR) Phase II project develops a cow's milk testing system using mobile spectroscopy and machine learning to provide rapid and automatic milk testing. The team aims to address the annual $32 billion global loss from bovine mastitis, an udder disease, due to the lack of farm-level early detection technology. The project helps farmers detect mastitis early, allowing them to increase farm operation efficiency, lessen the use of antibiotics, improve animal health, and reduce greenhouse gas emissions. The expanding herd size of dairy farms, shortage of labor, and rising dairy consumption across the globe are driving growth in the global livestock monitoring market which is expected to reach $19 billion by 2030. Globally, the total addressable market size is estimated at $12 billion. The technology under development in this Phase II project will enable precision dairy production by bringing cutting-edge technology to the farm and creating opportunities to attract and retain a new generation of dairy workers. The project?s mission is to support the dairy industry in delivering the best quality milk in an efficient and sustainable way.The intellectual merit of this project involves on-farm, real-time, and reliable testing of milk components such as somatic cell counts, fat, and protein, using mobile optical spectrometer technology that is controlled by physics-informed machine learning. An improved industrial design of the inline milk testing unit will be developed that is tailored for robotic dairy farms. Additionally, an embedded sampler prototype will be tested in conventional dairy farms to fully automate milk sampling and testing with the goal of developing a universal device that works for most parlor configurations. The operating wavelength range of the devices will be broadened using near-infrared and shortwave-infrared chips, which will not only increase the accuracy of fat and protein measurements but will also expand the testing to components such as lactose and milk urea nitrogen. From the data perspective, time-series measurements of somatic cell counts will be combined with historical herd-level and individual cow-level data such as days-in-milking, lactation, and yield, to build predictive models for mastitis and milk yield. Finally, optical signals such as fluorescence will be used to ascertain the presence of harmful pathogens in milk, to aid in the diagnosis of infections and prevent contaminated milk from entering the supply chain.This award reflects NSF's statutory mission and has been deemed worthy of support through evaluation using the Foundation's intellectual merit and broader impacts review criteria.