BiAffect, a new smartphone application, offers scientists and patients an unprecedented opportunity to understand mood and neurocognitive functioning in bipolar disorder. Through keystroke dynamics, such as typing speed and errors, BiAffect tracks and predicts mood episodes. It is a pioneering example of UI CDR’s team science approach in action, which brings together talent from psychiatry, engineering, computer science, and big data to make a profound impact on mood disorder.
Mathematical Equations on the Mind
“I think of everything as equations and patterns,” Dr. Alex Leow explains of the unique mindset that has influenced her career.
Leow, who joined UIC in 2009, represents the mental health aspects of BiAffect. She describes herself playfully as a “math physician.” It is a description that didn’t carry as much significance when she was earning her MD alongside a PhD in applied mathematics, but in an era of big data-driven precision medicine and bioengineering the term acquires more meaning.
“I think over the years I have always struggled to describe what I do,” Dr. Leow notes. “I am board certified in psychiatry and did my residency in psychiatry, but I have appointments in this department (psychiatry) and engineering.”
The combination of disciplines made her an anomaly when she was doing her dissertation, but as both fields advanced, the training poised her on the cutting edge of their intersection. It is a space that few others have the skillset to enter and a space where BiAffect could be created. Leow entered psychiatry because she found it fascinating. It was one of the most uncharted areas of medicine presenting many opportunities for discovery.
“No one has really been able to crack the code of the human brain,” she observes, confident that this generation of scientists has the key to finally doing so. “I think about all aspects of the human brain that can be understood using state-of-art data science and mathematics.”
In pursuit of this vision, Leow brought her curiosity and passion to imaging—MRI, diffusion imaging, functional imaging, EEG, neural stimulation—while also treating patients with bipolar. At the time, while her career was gaining momentum, neuroimaging represented the best avenue for cracking that code. It lead her to do her dissertation in imaging and become affiliated with the Laboratory of Neuro Imaging (LONI) at UCLA, but in the time since other avenues to gain this insight have opened up.
Mobile devices provide an unprecedented opportunity to investigate mood through the careful collection of active and passive data. They are reflections of ourselves capturing thoughts, impulses, emotions, and ideas in a more accessible fashion. Aspects of our identity and mood are recorded in unprecedented ways. Neuropsychological testing can require days of testing, long stretches of time with professionals collecting a range of data, but the mobile can replicate some of these findings through everyday use. For Leow, the cell phone offers another, in some ways more efficient, means to use mathematics to look at the workings of the mind.
Insight on a Complex Disorder
Bipolar disorder is difficult to understand, complicated to diagnose, and challenging to treat. Characterized by unusual shifts in mood, energy, activity levels, and the ability to function day-to-day, the disorder is deemed by the National Institute for Mental Health as “the most expensive behavioral health diagnosis” and one of the most often misunderstood.
Patients will often resist treatment without insights into their own behavior. During the down cycle of depression they may be feeling too low to take medication. Throughout the elation of the manic phase, they may feel too euphoric to continue treatment. These tendencies further complicate an already complex and challenging disorder.
Dr. Pete Nelson, UIC Dean of the College of Engineering, who represents the technical side of BiAffect knows this complexity firsthand. His son Caleb, now 24 years old, was diagnosed as a freshman in college. It is a common time for the disorder to reveal itself, when those affected are separated from their home and family for the first time. While there were earlier signs of the disorder, their meaning wasn’t clear until things spiraled out of control.
As is the case for many families, that initial diagnosis provided clarity for the Nelsons, who became involved in Caleb’s treatment.
“Successful treatments involve families,” Dr. Nelson, a computer scientist by training, observes of this period, “but often there are little or no objective measures of progress.” Nelson felt that objective markers, indicators outside of self or family report, were essential to successful outcomes.
“If my wife and I were sitting next to each other in session answering the simple question: ‘How is Caleb?’ We might respond with completely opposite answers,” He elaborates on the frustrating complications that surround the illness.
Further, Caleb himself, as with many afflicted by bipolar, might have a different perspective than both his parents. After the diagnosis, “two or three good years in a row” would be followed by a relapse seemingly out of nowhere. The unpredictable nature of the illness compounded by the lack of self-awareness, not just for the patient, but for all the members of the family, stood out for Nelson.
“I started looking at apps as a family member,” Nelson explains. “I thought it would be good if someone could really log very nonintrusive information about themselves and then also have feedback from people around them. The patient would be the complete driver of the response, but get honest insights into their own behaviors.”
Imagine an app that recognizes triggers when you are arguing with your partner or parents. Before you say something you regret, it cuts through escalating emotions as things get heated and gives you a sign to take it down a notch. Conceptually, this is an analogy to the kind of app Nelson was seeking. A technology that could indicate to someone afflicted with bipolar when they might be slipping into risky behavior, neglecting treatment, or otherwise blinded by their own emotions.
At the time, nothing was out there. There were pieces of similar projects that existed, but a design of the type that Nelson envisioned, something that could help his family, simply didn’t exist. He wanted a technology that could objectively monitor his son’s behavior close enough to help manage it, but that wasn’t available at the time.
Nelson has worked on a number of vexing problems throughout his career. He has been involved in other behavioral health interventions, contributed to the human genome project, resolved manufacturing and cybersecurity issues. In each project, the same type of forward thinking was required. As he puts it, “You don’t design for the hardware you have, you design for the hardware you imagine 3 years from now.”
He assigned the project to some of his undergraduates in a “very part-time mode” without funding, hoping they could put something together that would meet these needs when the tech was available. It stayed that way. A few years passed. A project in Europe was released with some thematic similarities. University of Michigan started doing some acoustical analysis into detecting mood.
Then a couple years into the project, over an informal lunch to welcome a new faculty member, an unexpected conversation would lead to a breakthrough.
A Dynamic Team Takes on the Mood Challenge
When Nelson met Leow for lunch, the project that would become BiAffect was not on his mind. It was routine to welcome new faculty members in the first 6 months of their appointment—a meet and greet—so he was due to connect in person. At that point the project was composed of handful of computer scientists under Nelson’s personal direction with little psychological input.
“I just took a chance,” he admits, “I told her about this little project that I was doing. She became very interested and ran with it.”
Ask either contributor now about the origin of different BiAffect components and they seem hard pressed to tell you. Leow attributes innovations to Nelson; Nelson credits Leow with various contributions. It is a genuinely collaborative effort emblematic of the team science approach that has grown considerably since those earlier undertakings. From world-renowned expertise in data-mining under the guidance of Philip S. Yu, UIC Distinguished Professor and Wexler Chair in Information Technology to the treatment of mood disorders with Dr. Scott Langenecker, Associate Professor of Psychiatry and Psychology at UIC, part of UI CDR Leadership and the Director of Cognitive Neuroscience, as well as, Dr. Olu Ajilore, Associate Professor in Psychiatry the program has grown in sophistication.
Initially BiAffect piggybacked on work conducted out of University of Michigan using acoustical analysis to detect mood, but it didn’t take long to pivot. Exercising that forward thinking anthem about designing for the hardware of the future, rather than the hardware available now they began to think text over talk. They started looking at the keyboard as an indicator by collecting metadata like timestamps, distances between keystrokes, keyboard inputs, rather than the content they looked at how the message was sent.
“If someone is in a manic episode they can lose the ability to “self-monitor,” in this case reading the texts before they send them, which we can see by how closely they edit,” explains Leow.
A BiAffect pilot study conducted on Android with 28 participants doing neuropsychological testing simultaneously to see if predictions using the keyboard metadata were accurate proved successful. Since, the team has on to beat out 70 applicants for the “Mood Challenge for ResearchKit” conducted by Apple, Robert Wood Johnson Foundation, New Venture Fund, and Luminary Labs.
ResearchKit, an open source software framework for iOS apps introduced by Apple to gather health data for scientists and clinicians integrates health tracking data—daily step counts, calorie use, heart rate—with other data points voice, timestamps, keystrokes to provide virtually endless amounts of data.
Nelson is pleased with how much the project has evolved since his preliminary search for an app came up empty. “In my lab, I have $2 million worth of projects, but this one is the most important to me.” He says with pride.
Leow though seems to have cribbed a page from the Dean’s playbook on looking ahead. She sees successful implementation for mood and psychiatric disorders as just the beginning of what this technology can do.
“For technology like this, we would be able to do neuropsychological testing without ‘testing.’ We believe that if we can really make this technology, it would be able to track people with other neuropsychiatric disorders such as Parkinson’s disease or other forms of neurodegenerative disorders.”
In the meantime, BiAffect is one of two finalists for the Mood Challenge for ResearchKit competition as it completes the incubation and testing stage. Winners will be announced in May 2017.