Rising suicide rates and depression in U.S. teens and young adults have prompted researchers to ask a provocative question: Could the same devices that some people blame for contributing to tech-age angst also be used to detect it?

The idea has sparked a race to develop apps that warn of impending mental health crises. Call it smartphone psychiatry or child psychology 2.0.

Studies have linked heavy smartphone use with worsening teen mental health. But as teens scroll through Instagram and Snapchat, tap out texts or watch YouTube videos, they also leave digital footprints that might offer clues to their psychological well-being.

Changes in typing speed, voice tone, word choice and how often kids stay home could signal trouble, according to preliminary studies.

There might be as many as 1,000 smartphone “biomarkers” for depression, said Thomas Insel, former head of the National Institute of Mental Illness and now a leader in the smartphone psychiatry movement.

Researchers are testing experimental apps that use artificial intelligence to try to predict depression episodes or potential self-harm.

“We are tracking the equivalent of a heartbeat for the human brain,” said Dr. Alex Leow, an app developer and associate professor of psychiatry and bioengineering at the University of Illinois’ Chicago campus.

At least, that’s the goal. There are technical and ethical kinks to work out — including privacy issues and making sure kids grant permission to be monitored so closely. Developers say proven, commercially available mood-detecting apps are likely years — but not decades — away.

“People often feel that these things are creepy,” because of the tech industry’s surreptitious tracking of online habits for commercial purposes, said University of Oregon psychologist Nick Allen.

Using smartphones as mental illness detectors would require informed consent from users to install an app, “and they could withdraw permission at any time,” said Allen, one of the creators of an app that is being tested on young people who have attempted suicide.

“The biggest hurdle at the moment,” Allen said, “is to learn about what’s the signal and what’s the noise — what is in this enormous amount of data that people accumulate on their phones that is indicative of a mental health crisis.”

Depression affects about 3 million U.S. teens, and rates have climbed in the past decade. Last year, 13 percent of 12- to 17-year-olds had depression, up from 8 percent in 2010, U.S. government data show. One in 10 college-aged Americans is affected.

Suicide has risen to the second leading cause of death for ages 10 to 34. Rates among teen girls doubled from 2007 to 2015, climbing to 5 per 100,000. And among boys, rates jumped 30 percent, to 14 in 100,000.

A recent study suggested a parallel rise in smartphone use likely contributed.

People with mental illness typically get treatment “when they’re in crisis and very late in the course of an illness. We want to have a method to identify the earliest signs,” in an objective way, Insel said.

If smartphones prove to be accurate mood predictors, developers say the ultimate goal would be to use them to offer real-time help, perhaps with automated text messages and links to help lines, or digital alerts to parents, doctors or first responders.

Facebook is already doing just that with what it calls “proactive detection.” Last year, after a live-streamed suicide, Facebook trained its AI systems to flag certain words or phrases in online posts that could indicate imminent self-harm. Friends’ comments expressing concern about the user’s well-being are part of the equation.

“In the last year, we’ve helped first responders quickly reach around 3,500 people globally who needed help,” Facebook CEO Mark Zuckerberg announced in November. Facebook has not disclosed outcomes of those cases.

The ongoing research includes:

— A Stanford University study involving about 200 teens, including kids at risk for depression because of bullying, family circumstances or other life stresses. As part of the research, teens who have been tracked since grade school get an experimental phone app that surveys them three times daily for two weeks with questions about their mood.

Researchers are combining those answers with passive smartphone data, including how active or sedentary kids are, to identify any changes that might be linked with future depression.

Study participant Laurel Foster, 15, acknowledges feeling stress over academics and “the usual” teen friendship pressures and says depression is rampant at her San Francisco high school. She said using the smartphone app felt a bit like being spied on, but with so many online sites already tracking users’ habits “one more isn’t really a big difference.”

“I feel like it’s good to actually find out what is stressing you,” Foster said, endorsing the idea of using smartphones to try to answer that question.

— At UCLA, as part of a broader effort to battle campus depression launched in 2017, researchers are offering online counseling and an experimental phone app to students who show signs of at least mild depression on a screening test. About 250 freshmen agreed to use the app in the first year. Personal sensing data collected from the app is being analyzed to see how it correlates with any worsening or improvement in depression symptoms seen in internet therapy.

Sophomore Alyssa Lizarraga, who had the app on her phone for about six months, said it was “a little like the Big Brother thing. Half of me felt that way. The other half felt like I hope it will be useful.”

Lizarraga, 19, has had depression since high school in Whittier, California. She has worried that she’s “addicted” to her phone and spends a lot of time on social media sites. “People need to see the best side of me” there, she said, and comparing herself with others online sometimes gets her down.

But using smartphones in a positive way for mental health might help nudge people to seek early treatment, if they could see how their phone use showed signs of depression, she said.

— At the University of Illinois’ Chicago campus, researchers studying depression and mania in bipolar disorder are using crowdsourcing to test their experimental phone app. Anyone can download the free app, and nearly 2,000 have so far, agreeing to let the researchers continuously track things such as typing speed, number of keystrokes and use of spellcheck. Participants include healthy people, and their data will help researchers zero in on changes in phone use that may signal onset of mood problems, said Leow, the psychiatry and bioengineering expert who helped develop it.

The study is for ages 18 and up, but if proven to work, the technology could be used in kids too, Leow said.

— Mindspring, a Palo Alto, California tech health company co-founded by Insel, the former National Institutes of Health chief, is testing a “digital phenotyping” app in several studies. Insel thinks the technology has promise to transform psychiatry, but that the most important question is whether it can be used to improve patient health.

— Verily, a tech health arm of Google parent company Alphabet, is developing a similar app but declined to elaborate beyond a written statement from its mental health leader, Menachem Fromer. He cited two key goals: making predictions about someone’s mental health and their symptoms and “discovering new subtypes of disease that may inform treatment decisions.”