Cardiogram last week announced that it has developed a preliminary algorithm to use with the Apple Watch and Android Wear devices to detect atrial fibrillation with higher accuracy than previously validated detection methods.

Atrial fibrillation, or AF, affects about 2.7 million Americans, and increases the risk of stroke by five times. Overall, it causes about 15 percent of strokes.

Cardiogram trained a deep neural network using heart rate readings taken from Apple Watches.

The company sent 200 AliveCor mobile electrocardiogram devices to people diagnosed with AF. The test subjects recorded 6,338 mobile ECGs, each associated with a positive or negative atrial fibrillation label generated by the devices.

Cardiogram applied 139 million heart rate measurements to retrain its neural network to predict the average variation in heart rate readings over various time windows.

To validate its architectural model, Cardiogram obtained gold standards from cardioversions — that is, incidents of returning a patient experiencing AF to a normal sinus rhythm through chemical or electrical treatments.

Cardiogram has been working with medical researchers from UCSF’s Health eHeart Study, and a total of 51 patients at UCSF Cardiology wore an Apple Watch during their cardioversions.

Heart rate samples were taken during AF and after cardioversion.

Cardiogram’s algorithm was able to detect atrial fibrillation with 98.04 percent sensitivity and 90.2 percent specificity.