“If someone is depressed, for instance, they isolate themselves, have a hard time getting up to go to school or work, they’re lethargic and don’t like communicating with others the way they typically do,” Madan explains. “Turns out you see those same features change in their mobile-phone sensor data in their movement, features, and interactions with others.”

That’s the concept driving Ginger.io’s recently released commercial app, based on years of MIT Media Lab research, which is becoming increasingly popular in the health care industry. By passively analyzing mobile data, the app can detect if a patient with mental illness — such as depression, anxiety and bipolar disorders, or schizophrenia — is acting symptomatic.

Symptoms may include lethargy (decreased movement captured by motion sensors) or infrequent texts (captured by the message log). If the app detects an unusual pattern, it sends text messages to both the patient and his or her health care provider, who can keep tabs and intervene if necessary.

Currently, the app is being used by thousands of patients at more than 25 health care institutions and academic centers across the United States, driving several thousand alerts in the past few months.

It has also been used in research. At the University of California at San Francisco, for instance, the app is being used to look at the role behavioral data plays in heart disease. And with Forsyth Medical Center in North Carolina, Ginger.io is studying how data can help discern behavioral differences in diabetes patients. If a diabetic patient becomes depressed, for example, she may stop taking medication — something called “noncompliance” — which could lead to costly visits to the doctor or emergency room. But with the app, a nurse could call and remind the patient to continue taking medication.

In a recent trial at the University of California at Davis, the app was used as a low-cost method of monitoring youth with psychosis. “Early intervention in psychosis is crucial,” Madan says, “but it requires expensive, intensive patient assessment and monitoring.”

Ginger.io, on the other hand, can be used to collect data and, potentially, prompt early intervention of symptomatic patients to prevent relapses, improving outcomes and reducing costs. The data provided by Ginger.io in this study was used to model daily fluctuations in patient symptoms, and results indicated that Ginger.io is a feasible platform for monitoring those with early psychosis.

Catching deviations

To use the Ginger.io app, patients fill out a brief survey about their conditions, treatment, and health care provider. The app then begins passively collecting millions of interaction and location data points. Motion data is captured by a phone’s accelerometers. Global positioning systems pinpoint where a person visits. It also logs the duration and frequency of phone calls and texting patterns — though it ignores information about who a patient contacts.

For a few days, the app records a person’s normal patterns. After that, algorithms look for significant deviations; if there are any, the app spells them out on the screen. A text may read, for instance, “On Wednesday, you spoke with two fewer people” (signaling isolation), or “You traveled 50 percent less on Thursday” (signaling lethargy).

If the algorithms detect enough deviations to determine that “the patient is behaving in a way that’s inconsistent with usual,” Madan says, it alerts the health care provider via Ginger.io’s Web platform. The provider may see a text readout explaining, for instance, that the patient is increasingly acting isolated or lethargic. Or they may see a green box next to the patient’s name turn to red, signaling a need for intervention.

“In most of those cases, the institutions have already set up care-management programs and teams responsible for keeping people healthy, so when they get the alert, they call and see what’s really going on,” Madan says. “Then, they make that decision of having the patient come in to see a doctor or handle the issue over the phone.”

A major aim of Ginger.io, Madan says, is to use such “big data” analytics to move health care toward preventative measures — intervening before patients end up in emergency rooms, running up medical bills. “Acting on that information while it’s still the right time, when patients can correct their behavior, could certainly change the way we deliver care,” Madan says.

From the lab to “the trenches”

The core technology for Ginger.io is based on research by Madan; Alexander “Sandy” Pentland, the Toshiba Professor of Media Arts and Sciences, who cofounded the company and now serves as an advisor; and several colleagues in the Human Dynamics Lab. They spent years experimenting with “reality mining”: applying algorithms to mobile data to see how people move, behave, and — potentially — spread disease. Shifts in how people use their phones and where they travel, they found, can reflect the onset of a cold, anxiety, or stress.

Eventually, that research sprouted some interesting findings about how people with depression behave when they’re symptomatic, Madan explains. “I realized this was something that could find meaning beyond the 80 people in my study; it could have significant impact on the way we think about health care. That was the driver to start a company,” he says. Madan and Pentland soon recruited a third co-founder, Karan Singh MBA ’11, now Ginger.io’s head of sales and marketing, to help grow the business.

At the time, Madan had already dabbled in MIT’s entrepreneurial ecosystem, having previously entered the $100K Entrepreneurship Competition, which helped him “get over the hump” of building a business by teaching him how to create a business plan.

Taking classes at the MIT Sloan School of Management — such as 15.390 (New Enterprises) — and chatting with mentors from the Venture Mentoring Service and the Martin Trust Center for MIT Entrepreneurship further helped Madan and Singh understand the nuances of building a startup, including recruiting talent, engaging early customers, speaking with investors, and scaling the product.

“After testing the entrepreneurial waters, these resources and classes were fundamental for me personally to make the transition from researcher to entrepreneur,” Madan says. “They provided me with the rich information and network required to be successful.”

Today, Ginger.io has offices in San Francisco and Cambridge, and is poised to grow significantly. In the past five years, Madan says, there’s been an explosion in sensing data (such as wearables), accompanied by a massive shift in the health care system to focus on keeping patients healthy.

“There’s a movement in bringing sensors and new technologies into the clinical workflow, so health care providers can have access to real-time information and react in a timely manner,” he says.

The startup is working “in the trenches,” as Madan likes to say, seeking ways to broadly implement its technology. This involves training health care providers in using the technology and finding how best to manage interventions. Madan says: “We’re looking to really scale through the health care system in the next couple of years.”