By Luke Stangel

Every morning, 620,000 cows in New York state wake up and go to work, each pumping out an average of 7.5 gallons of milk every day.

But not every gallon of milk is created equally. Most cows produce great milk: clean, fresh-tasting, creamy, and high in protein and milk fat.

But a small number of cows don’t–they might be sick that day, and produce milk with high levels of bacteria known as somatic cells. If the farm’s overall somatic cell count is too high, the dairy farmer will have to dump the day’s shipment of milk onto the non-human market, where prices are far lower.

Buffalo-based SomaDetect is building a new milk quality testing system that uses a combination of lasers and artificial intelligence to evaluate milk as it’s being produced, automatically flagging irregularities in real-time. The system identifies cows producing low-quality milk, allowing the farmer to pull specific cows off the production line, protecting the overall quality of the day’s production.

“SomaDetect is about farmers increasing the level of control of their herd,” SomaDetect CEO and cofounder Bethany Deshpande said. “Which cows are contributing the most, and why? As soon as there’s an issue, being able to address that issue, in terms of disease.”

SomaDetect is conducting live testing at Cornell University in Ithaca, and secured a group of early test farms, which will get their systems starting this fall. The two-year-old company has raised $3 million in capital to date, and plans to close its next round of funding early next year. It employs 15 people, with offices in Buffalo and New Brunswick, Canada.

The company believes it can sell its laser-based milk quality system to the roughly 40,000 dairy farms operating in the U.S. today, and the many thousands more dairy farms operating globally. In New York alone, the state’s 4,461 dairy farmers sold $2.7 billion worth of milk last year, according to a preliminary estimate from the New York Department of Agriculture and Markets.

Here’s how it works: SomaDetect’s laser shoots through the stream of milk, creating a scatter pattern on the other side that’s instantly analyzed using deep learning and artificial intelligence.

In less than a second, SomaDetect tells the farmer how much fat, protein and somatic cells are in the milk–all major factors that affect the value of that’s day production. It gives the farmer progesterone counts, telling him or her if the cow they’re looking at is ready to be bred, or is pregnant. It also flags unusual levels of somatic cells and antibiotics, which can cause milk processors to reject the day’s load.

“We’ve been finding that farmers understand the benefits immediately. Convincing farmers of this technology has never been the hard part,” Deshpande said. “The hard part is getting investors to really understand what we’re doing, and the impact. Most farmers, we can go to a farm, explain what we’re doing and they get it–they understand how they’d use that data.”

Deshpande estimates SomaDetect will generate farmers a return on investment of around $680 per cow, per year.

For years, farmers have had to rely on technicians who travel out to the farm once every six weeks, gathering and labeling milk samples from every cow in the herd. Those samples get sent to a traditional testing lab, and farmers eventually get back a report capturing that single moment in time.

SomaDetect costs about the same as traditional testing. The company was cofounded by Nicholas Clermont, who serves as its Chief Design Officer, and Bharath Sudarsan, Head of AI.

Deshpande said running her business in Buffalo makes sense, given her customer. New York remains the third-largest producer of dairy in the U.S., and millions of cows live within a 6-hour drive of the company’s headquarters.

“So many folks have never been to a farm. In a lot of ways, we’re disconnected from the industry,” Deshpande said. “In think in these cities like New York and San Francisco, there’s a certain type of buzz there, and it’s very rarely in the agtech direction. If you don’t know the space, you don’t know that there’s tons of opportunities still left in agtech.”

Deshpande will be speaking at “The Future of Food,” an agriculture- and food technology-focused event Wednesday, Sept. 26 at Hourigan’s Dairy Farm in Elbridge. Click here for more information.