Before modern chemistry brought doctors blood and urine tests for diagnosing diabetes, they had to rely on their taste buds. Sweet-tasting pee has long been the disease’s telltale biomarker; mellitus literally means honey. Too much sugar in your bodily fluids means your metabolism has gone haywire—either your cells aren’t making insulin or they’re not responding to it.

But a little over a decade ago, a group of researchers discovered a less obvious link. One of the complications of diabetes is nerve damage, and in the cardiovascular system that damage can cause irregular heart rates. Which you can measure, either with electricity or light. So one day soon, doctors might diagnose diabetes with their patients’ wrist bling instead of blood pricks or pee strips. Oh, what difference a few centuries make.

In 2005, heart rate sensors were something only elite athletes and very sick people used. Today, one in five Americans own one. Which is why there’s now a deep learning company trying to make something out of the connection between heart rate and diabetes. On Wednesday, at the annual AAAI Conference on Artificial Intelligence in New Orleans, digital health-tracking startup Cardiogram presented research suggesting the Apple Watch’s heart rate sensor and step counter can make a good guess at whether or not a person has diabetes—when paired with the right machine-learning algorithms, of course.

Apple has been eyeing a career change—from personal trainer to personal physician—for its signature wearable for a while now. In November the company teamed up with health insurer Aetna to give away more than 500,000 Apple Watches as part of a pilot to try to reduce health costs. And it embarked on a study with Stanford to test the watch’s skills at detecting irregular heartbeats, which can lead to stroke or heart attack. This most recent collaboration between Cardiogram—a San Francisco-based startup staffed by former Google engineers—and a landmark UC San Francisco heart health study is just the latest in these moves.

Cardiogram offers a free app for organizing heart-rate data from the Apple Watch and devices with similar sensors—from companies like Fitbit, Garmin, and Android Wear. It uses the same kind of artificial neural networks that Google uses to turn speech into text, and repurposes them to interpret heart-rate and step-count data. On its own, that data is mostly meaningless for detecting disease, and not just because the sensors themselves have significant errors. Training a model that can pick out condition-specific patterns requires labeled data. To learn what a diabetic heart rate signature looks, it needs some diabetics.

That’s where UCSF comes in. In 2013 it kicked off a major heart disease project called the Health eHeart study, aiming to collect massive amounts of digital health data on one million people. As of mid-January, the study had registered 196,000 participants, who each fill out a survey about known medical conditions, family histories, medications, and blood test results. About 40,000 of them have also opted to link that information with their Cardiogram app.

“That’s where we get our labels,” says Cardiogram co-founder Brandon Ballinger, who previously worked as a tech lead on Google’s speech recognition software. “In medicine, your labeled answers each represent a life at risk. Compared to what an internet company is working with, it’s actually a very small number of examples.”

So Cardiogram has had to adopt some tricks from the tech world to train its neural network, DeepHeart, to spot human disease. One of these is a technique called semi-supervised sequence learning, which was originally invented to work on text data like Amazon product reviews. But instead of a sequence of words, they sub in a sequence of heart rate measurements—about 4,000 per week. Some fancy math compresses that information into a single number summarizing the amount of heart rate variability. Then those summaries are what get tied to labeled patient data, and the real training can begin.