YECHANG, China/HONG KONG -- Piles of manure and swarming flies make the Brother Farm deep in northern China seem unremarkable at first glance, but a quick look at its milking facility suggests this is no ordinary dairy farm.
Four overhead cameras capture one image per second of cows as they arrive to be milked. The photos are being used to develop one of China's most advanced agricultural technologies.
"Artificial intelligence is already capable of identifying human faces. Now, we want to teach AI how to identify cows," said Zhao Jinshi, founder of Beijing Unitrace Tech, the company behind the technology.
Once trained, Zhao said, the AI-powered system will help monitor the movement of every cow and alert farmers if an animal starts behaving strangely. Staff at Chinese ranches currently have to spend hours every day walking around fields, trying to spot sick cows among the herd.
Facial recognition for cattle is just one of many experimental technologies that Zhao and his peers are pioneering. As labor costs rise and society rapidly ages, farmers across China are embracing modern solutions to raise the productivity of their ancestors' methods.
In the far western region of Xinjiang, crop growers use self-driving tractors to work around the clock and disperse seeds evenly throughout vast swathes of farmland. Fish farmers in Zhejiang Province on the east coast have installed smart sensors to monitor their ponds' oxygen levels and adjust supplies in real time.
China's leading technology companies see the growing demand. In November, online retailer JD.com said it was working with local universities to "digitize traditional agricultural practices" and "provide individualized feeding plans for pigs" through AI-enabled analysis.
Its larger rival, Alibaba Group Holding, has run similar projects. In June, the conglomerate claimed that its voice recognition technology could detect the grunts and squeals of piglets that were in trouble, helping to minimize accidents and reducing unnatural deaths by 3%.
Agriculture is the latest area in which AI and other technologies are transforming the country. Having previously relied on cheap labor to compete with Western manufacturers, companies now look to automation to help maintain their cost advantage. Every year since 2013, Chinese factories have installed more industrial robots than their counterparts in any other country.
Chinese hospitals are increasingly adopting AI to cope with manpower shortages, for example to read more CT scans with a higher degree of accuracy.
Market observers say the integration between technology and farming will be the next big thing.
"This is certainly an emerging trend," said Victor Ai, a managing director of China Everbright, a Beijing-based venture capital group. "As labor costs in China have increased significantly, agricultural businesses have no choice but to boost efficiency. That requires the use of high tech."
Ai, whose previous investments include AI unicorn SenseTime and New York-listed electric carmaker Nio, said tech startups serving traditional sectors such as agriculture have become a priority on his watch list.
"We believe China's next unicorn will come from there," he said.
Zhao, who founded Beijing Unitrace Tech in 2009, was not motivated to develop homegrown agritech by the prospect of financial reward, but by a personal mission to foster agriculture in his country.
The 37-year-old Shanxi native was born into a veterinary family and grew up reading livestock journals. After witnessing how management software had streamlined production at American cattle farms during his time at Cornell University, Zhao decided to bring similar services to Chinese farmers.
Today, he claims his company provides cloud-based management services to nearly two-thirds of the cattle farms in the country. With facial recognition technology making waves in Chinese cities, Zhao spotted another opportunity.
"Most cattle farms in China have at least 1,000 cows. It is impossible to keep a close eye on each one," Zhao said. Often, when farmers spot a sick animal, it is too late or too expensive to treat it.
The system developed by Zhao and his team works by identifying each cow through cameras above the troughs and recording how many times it feeds a day. This figure, together with data collected from drinking, milking and other activities, goes into an online platform that compares the information with historical data and analyzes the animal's health.
If the system notices a suspicious change, it sends an alert for further inspection.
The company, which built its solution on an open-source machine-learning framework developed by Google, tested five algorithms using tens of thousands of photos generated from Chinese cattle farms before it determined a suitable one. Yet, Zhao insists the technology remains in its infant stage.
For instance, the system can identify cows at an accuracy rate of 90% when the animals are feeding, but is less successful when they are drinking.
Still, many farmers like Zhang Jiangshui are keen to give it a try. The owner of the Brother Farm in Hebei Province, one of the country's poorer regions, is so cost-conscious that he grows radishes rather than flowers outside his office.
When he heard about the facial recognition technology from a friend last year, he spent several hundred dollars to buy cameras and retrofit facilities to participate in the pilot. The driving force, he said, was China's fast-changing farming sector.
In recent years, many small-scale operations have given way to large commercial cattle farms, as Beijing pushed for industrializing the sector in pursuit of economies of scale and tighter controls on pollution.
"When one rancher looked after 10 cows, he could take good care of each one," Zhang said. "Today, one rancher has to take care of at least 70 cows, and the workload is simply beyond his capacity."
But hiring more hands is not an option. The average salary in Zhang's village has nearly doubled in the past five years, and rural China, like the rest of the country, has an aging population. Few of the remaining young workers dream of sweating in a field.
"I think smartening up agricultural production is the only way for us to move forward," Zhang said.
Applications for Zhao's product are even being found in peripheral industries. Haier Financial Holdings, an arm of the Hong Kong-listed electronic appliances maker, recently adopted the system at two farms in the Ningxia region, where the company looks after livestock that has been taken as collateral for loans.
As part of its risk control procedures, the company usually sends staff to thousands of farms scattered across China to inspect cattle, said Lin Jin, head of the company's agriculture unit. But if pilots of the system go well, Lin said his team may be able to monitor cows remotely instead of visiting the farms every three months.
"The use of AI and big data will also help ranchers improve production efficiency," Lin said. "Once our clients become more profitable, they are more likely to pay back their loans."
But for those who lack support from large companies, deploying agritech remains a challenge, said Jan Hinrichs, an economist with the Asian Development Bank in Manila. Smart sensors and other high-tech equipment carry a price tag, and not every farmer in China can afford the upfront investment, he said.
Technical hurdles also are an issue, especially for the older generation, as is the application of lab work in the real world, he added.
So far, the nine-month pilot has thrown up a number of unexpected issues. After installing cameras at the milking facility, Zhao realized that even if his system could identify cows correctly, the camera might capture the wrong face as cows tend to swing their heads around. The company is teaching the AI how to identify a cow's back as well.
While it has yet to make a meaningful difference to his operation, Zhang remains confident.
"After all, facial recognition has already been widely used on humans. How difficult can it be to identify cows?"