Two quantitative analysts using artificial intelligence in an online data science competition showed they could diagnose heart disease about as accurately as doctors.

Qi Liu and Tencia Lee, hedge fund analysts and self-described “quants,” built the winning algorithm in the competition, which could find indicators of heart disease. The online data contest challenged participants to develop machine algorithms that could measure cardiac volumes from MRIs provided by the National Heart, Lung and Blood Institute.

Mr. Liu and Ms. Lee didn’t know each other before they won the competition, beating out more than 1,390 algorithms. They met each other in a forum on the Kaggle site, where the competition was hosted over a three-month period.

“We decided to combine our methods,” Ms. Lee said. “We decided they were different enough from each other that we could do better than either of us would alone.”

Competitors worked on algorithms that could accomplish a manual and slow process that normally is carried out by cardiologists. Usually it takes doctors about 20 minutes to measure cardiac volumes and derive ejection fraction data from an MRI. The algorithms can analyze the images much more quickly.