You've probably heard that diabetes can lead to blindness. This complication is called diabetic retinopathy (DR), when blood vessels are progressively damaged in the retina. It's the leading cause of preventable blindness in the world.

Screening and early diagnosis are crucial for treating this problem, but more than 50 percent of all cases go unnoticed. Now 16-year-old Kavya Kopparapu, whose grandfather in India was diagnosed with DR, has invented a simple, cheap new screening tool for it.

"The lack of diagnosis is the biggest challenge," she told IEEE Spectrum. "In India, there are programs that send doctors into villages and slums, but there are a lot of patients and only so many ophthalmologists."

Her solution? To develop a smartphone app that can screen for the disease with the help of a specially trained artificial intelligence program and a simple 3D-printed lens attachment.

This ingenious system is called Eyeagnosis, and Kopparapu - a high school junior - recently presented it at the O'Reilly Artificial Intelligence conference in New York.

Typically, a diagnosis of DR involves a fancy retinal imaging machine that takes photos of the back of the eye. The cost of the equipment and availability of trained staff makes the procedure inaccessible for many.

Kopparapu, already excelling at computer science and fascinated by artificial intelligence, decided to train a neural network to recognise pictures of what DR looks like. Together with her team - her brother Neeyanth and classmate Justin Zhang - they looked for a suitable network, settling on Microsoft's ResNet-50.

Neural networks take machine learning to high-intensity bingeing levels, scanning huge datasets and extracting the similarities that emerge. If you need to recognise a particular type of retinal problem in the patterns of the blood vessels, it's the perfect way to learn.

The team fed their neural network a database of 34,000 retinal scans from the National Institute of Health (NIH). A lot of those scans are of rather poor quality, but that was actually helpful, given that the goal was to create an app that uses the smartphone camera as the imaging tool.

And that's where the next clever step comes in - to scan the retina without the use of a huge machine, the app uses a simple 3D-printed lens that concentrates light from the smartphone camera flash on the back of the eye.

Eyeagnosis appKavya Kopparapu/IEEE Spectrum

Once the system seemed to be working, Kopparapu arranged for tests at a Mumbai hospital to see how the app would perform in a real-life setting, and so far it's done just as well as a human specialist, although the data is limited.

"What she's going to need is a lot of clinical data showing that [Eyeagnosis] is reliable under a variety of situations: in eye hospitals, in the countryside, in clinics out in the boonies of India," ophthalmologist J. Fielding Hejtmancik from the NIH told IEEE Spectrum.

But he also admits that the app has excellent potential, noting that its main drawback might be the fact it's too cheap, with companies looking for tools with bigger profit margins (excuse us while we scream incoherently about this).

Kopparapu is unlikely to be deterred by this fact, though. When developing this new tool, she consulted with many experts in the field - ophthalmologists, biochemists, AI experts, neuroscientists and more.

As a passionate advocate for accessible computer science, she spoke at this year's March for Science in Washington, DC and has presented a TEDx talk, which you can watch below to learn more about Eyeagnosis.

Kopparapu is also the founder and CEO of Girls Computing League, a nonprofit that provides computer science and coding workshops to underprivileged groups, and features an impressive list of executive supporters and commercial sponsors.

"In my future career, I don't want to be known as a girl that happens to be a computer scientist; I want to be known as a computer scientist that happens to be a girl," she said at the March for Science.

We can't wait to see what she comes up with next.