When she was in her early teens, Rokhaya Diagne would retreat to her brother’s room, where she played online computer games for hours, day after day, until her mother finally got fed up.
“My mom said, ‘This is an addiction,’” Ms. Diagne said. “She said if I didn’t stop, she would send me to the hospital to see a psychiatrist.”
Her mother’s interventions worked. While Ms. Diagne’s passion for computers has, if anything, intensified, she has redirected her energies to higher pursuits than leveling up at Call of Duty.
Now, her goals include using artificial intelligence to help the world eradicate malaria by 2030, a project she is focused on at her health start-up.
Video games “taught me a lot of things,” said Ms. Diagne, 25, a Senegalese computer science major who lives in Dakar, the capital. “They gave me problem-solving skills.”
“I don’t regret playing those things,” she added.
A fast talker in bluejeans and hijab, Ms. Diagne is part of a subset of Africa’s enormous youth population whose lives have been shaped by screens and the internet — and who are connected to the world to a degree that no generation before them could have imagined.
For young Africans interested in technology-related careers, the internet has offered a powerful addition to an education system that some experts worry is hobbling Africa’s ability to take advantage of its young people. While graduating more students than ever before, schools still rely heavily on stand-and-deliver lectures.
The wealth of free online coding boot camps, robotics lessons and lectures from the likes of Stanford, Oxford and M.I.T. are having a big impact across Africa, inspiring careers in engineering and seeding ideas for start-ups.
While some of her cohorts are most passionate about sensor fusion or robotics, Ms. Diagne is into artificial intelligence and machine deep-learning. She helped create an award-winning networking app to meet others with similar interests — like Tinder but for tech nerds. And she founded a start-up called Afyasense (she borrowed “afya,” or health, from Swahili, an East African language) for her disease-detection projects using A.I.
“She is someone with whom talking is a pleasure due to the quality of the questions she asks and also the answers she gives,” said Ismaïla Seck, a leader in Senegal’s growing A.I. community.
Like many other young people in Africa’s tech boom, Ms. Diagne is at the center of overlapping phenomena on the continent — a growing, educated middle class raising even more educated children who, with each tap on a keyboard, have adopted a sense that the continent’s biggest problems can be solved.
Ms. Diagne wants to use A.I. to improve health outcomes in the region, a choice she made after a range of childhood illnesses landed her in Dakar hospitals, which struggled to provide consistent, quality care.
“I know the mistakes that are unfortunately made,” she said.
Ms. Diagne’s drive has earned her recognition. Her malaria project recently won an award at an A.I. conference in Ghana and a national award in Senegal for social entrepreneurship, as well as $8,000 in funding.
As a child, she said she was reserved but always has had a huge appetite for research, fed by her father, a retired literature professor and writer. When faced with his daughter’s questions about how the world worked or about her Muslim faith, he would make her try to find the answer herself. He rewarded her with apples, still her favorite fruit.
She enrolled at the École Supérieure Polytechnique de Dakar as a biology major and scored an internship at the Principal Hospital of Dakar. But days of reviewing lab samples helped her realize that kind of work wasn’t for her.
“I wanted way more challenges than fearing the bacteria in my body,” she said. “What I wanted was innovation and being able to create and use my brain for something instead of predictive results that I just followed.”
Dejected that she had made the wrong choice, Ms. Diagne dropped out of school and spent a year plotting her next steps.
She recalled something her brother used to tell her: Do things that are harder because there’s less competition. She picked bioinformatics, the science of both the storing of complex biological data and of analyzing it to find new insights. The options for studying it in Senegal were extremely limited.
But the Dakar American University of Science and Technology had opened and offered a major in computer science, a field she decided would offer a solid foundation for future studies in bioinformatics.
The university’s approach emphasizes applied learning, meaning instructors assign projects to students and expect them to finish largely on their own. And the assignments always aim to solve a local problem.
One project tasked students with building a drone capable of carrying a 100-kilogram payload a distance of 10 kilometers, an act that could help relieve the polluting congestion of trucks outside Dakar’s port. Some of the university’s joint projects already have yielded promising start-ups such as Solarbox, which began as an assignment to build a solar-powered electric motorbike.
Ms. Diagne, who is now a senior, was assigned to send an underwater drone to collect information about fish as well as seagrass, plants that absorb carbon.
“When I started, I didn’t even know what seagrass was,” she said. “I’d only seen an underwater drone in movies. I didn’t even know the difference between types of fish.”
She threw herself into the project, even hiring a fisherman she spotted on the beach to teach her to fish so she could learn more about various species from someone who knew firsthand. Her team is moving on to the next phase: building their own underwater drone.
As she was looking for another project, she learned that global health officials were working to eradicate malaria before the decade is over. One of Senegal’s biggest health problems is the lack of quick and reliable malaria tests in rural areas. So she set out to design a better system of identifying positive cases.
Ms. Diagne thought back to her boredom in the hospital lab, examining biological sample after sample. That rote act seemed tailor made for A.I. to tackle.
First, she needed to find a lab that would give her a large set of malaria-infected cells that she could train A.I. to read. But some labs in Senegal are accustomed to sharing data only with researchers from abroad.
“They will openly give information to those people, but when it comes to little Africans like me who are still learning, they don’t want to help us,” Ms. Diagne said.
Her school helped her find a lab operator who gave her a cell data set that she fed into a deep learning tool, training it to spot positive cases. Users will plug microscopes into a laptop loaded with her A.I. program — including 3D-printed microscopes that are inexpensive and small enough to be deployed in rural areas.
As her malaria project gets closer to going to market, Ms. Diagne already knows what she wants to undertake next: using A.I. to detect cancer cells.
Ms. Diagne has relied on her university’s leaders and on West Africa’s growing tech community, who have been eager to offer advice as her projects earn recognition.
“They’ve been pushing me so that I can get out there and show to the world what I do,” she said. “Well, they haven’t succeed in that part yet.”
But she’s moving in that direction. The Ghana A.I. conference was her first trip abroad, and later this month she will travel to Switzerland for an innovators training program to get more help launching her malaria project.
And she’s ready to lend a hand to those coming up behind her.
“A lot of people are reaching out to me, saying, ‘how did you do this, how did you do that,’” she said. “I can mentor them and show them the way.”