Suicide is an act of violence whose roots are often impenetrable. Depression, physical illness, financial despair, loneliness, impulsivity — we can’t truly know what mix of factors leads someone to end their life.

But what if this complicated human impulse could be prevented through the cold logic of artificial intelligence?

According to a recent blog post by the Online MSW program at the University of Southern California, that’s the aim of a pair of professors who want to harness the computations powers of AI to detect potential suicides. Specifically, their project will mine data for signs of social isolation, using intelligent machines to spot subtle patterns in thoughts and behavior that might escape even the most rigorous statistical analysis by humans.

“There are a lot of AI tools that could be used to make a difference in the world right now,” said Eric Rice, a professor at USC’s Suzanne Dworak-Peck School of Social Work and a co-founder of the Center for Artificial Intelligence in Society (CAIS).

“Social scientists and computer scientists (are) really coming together and trying to do what neither group could do by themselves,” said Rice, whose center’s mission statement is “artificial intelligence for social good.”

AI has come a long way since 1997, when IBM’s Deep Blue defeated the world chess champion Garry Kasparov in a six-game match. Today, cars can drive themselves and your phone can converse with you, thanks to machines with human-like smarts.

What’s more, AI in some cases can outperform humans even in complex fields like psychiatry. In 2015, researchers from IBM, Columbia University and elsewhere build a computer program that predicted with 100 percent accuracy which high-risk youths would develop psychosis loss of touch with reality by analyzing their speech patterns and coherence.

It’s not so surprising that AI can succeed when doctors might falter. Mental health disorders can lack objective tests for definitive diagnoses. Even experienced clinicians are apt to miss or misinterpret symptoms. As for suicides, both clinicians and patients are bad at predicting self-harm, in part because people hide their suicide ideations and because killing oneself often is an impulsive act.

Research shows that certain types of suicide interventions are proven to work. One is to remove access to lethal means, such as guns and pesticides. Another is to maintain “caring contacts” with high-risk individuals through calls, visits, emails and letters.

Eliminating social isolation is precisely what Rice, the USC professor, and his colleagues are targeting at CAIS. Working with three populations homeless youths, college students and military members — their goal is to prevent suicides through forecasting. In other words, they believe they can predict suicides by spotting when someone is thinking about it.

On college campuses, for instance, algorithm can search through friendship networks to identify the most influential peers, Rice told USC’s Online MSW program. These students then will be recruited and trained to look for depressed or suicidal thinking, taking over a role that nominally had been held by dorm monitors and other, less effective authority figures.

CAIS plans to test to concept at the University of Denver in spring 2018.